Tuesday, November 15, 2011

Invalid page URL” New Item in sharepoint

Suppose you use Microsoft Office SharePoint Designer to customize the NewForm.aspx page of a list in SharePoint, you connect to the list by using a Web browser.You may face any of the following issues.
  1. You click New to create a new item in the list. In this scenario, you may get the following error message “Invalid page URL:” a small JavaScript pop up window that appears on the screen.
  2. You get this error message “An unexpected error has occurred” when you click an existing item in the list.
  3. Additionally, you might view the properties of the list in SharePoint Designer 2007 and then specify the NewForm.aspx page in the New item form box. When you do this, the NewForm.aspx page appears to be saved as the new item form when you click OK. However, the next time that you view the properties of the list, the New item form box is empty.
Reason for the issue : This issue occurs if you deleted the List Form Web Part from the NewForm.aspx page.

Solution :

To resolve this issue

1) delete the list, and then re-create it. Then, customize the NewForm.aspx page. When you customize the NewForm.aspx page, make sure that you do not delete the List Form Web Part.
If you want to customize the controls that appear on the NewForm.aspx page, and if you do not want to show the default List Form Web Part, you can hide the List Form Web Part. To do this, follow these steps:
  1. Start SharePoint Designer 2007, and then open the NewForm.aspx page for the list.
  2. Right-click the List Form Web Part, and then click Web Part Properties.
  3. Expand Layout, click to select the Hidden check box, and then click OK.
OR

2) Restore the List form Webpart, refer : http://madhunomula.blogspot.com/2011/11/restore-list-form-web-part-for-editform.html

Restore list form web part for EditForm

Restore list form web part for EditForm

Yesterday I spent the whole day finding on the Internet about how to restore the list form web part of my edit form as I accidentally deleted it and could never get it back from the Closed web parts, nor could I get it back by resetting the file to site definition in Sharepoint Designer. It is really important to remember that the original edit form, display form and new form should never be deleted, but kept as hidden if we had to customise them.

What happened after I deleted my edit form, caused the edit link to disappear in the display page, nor could I edit properties of any item, or it will just redirect to the AllItems.aspx page. So, to retrieve the edit form back, what we do is:

1.In Sharepoint Designer, open the EditForm.aspx and DispForm.aspx. Grab a copy of both files and paste them in Notepad for backup.

2.On EditForm.aspx, go to Designer mode, click on the spot behind your own edit form, and go to Insert -> Sharepoint Controls -> Choose Edit item form, assign the right list in the dropdown on top. That should put back the original edit form. Designer will render it as error but that's okay.
3.Next, on DispForm.aspx, copy the Display Form web part code in code behind, and then back to EditForm.aspx, find the code which Sharepoint Designer just inserted for you (the original edit form), and paste the DispForm code there. Don't go to the Design mode now!
4.Change the ControlMode from Display to Edit.(Note: forNewForm change it to "New")
5.Change the FormType to 6.(Note: forNewForm change it to 8)
6.Save the page.

Try it on Sharepoint site to see if it is working. It should, if not then it's really cooked and you can try changing the Guid ID of the web part and ID.

Friday, September 16, 2011

View/Hide content in sharepoint

Pace the code in html page and upload in to a page library and show it in page viewer webpart

<html>
<head>
<style type="text/css">
<!--
criteriaResp {
 margin-bottom: 10px;
 margin-top: 0px;
 margin-right: 0px;
 margin-left: 0px;
}
.hoverTextResp {
 border: thin solid #999999;
 font-family: Calibri;
 width: 555px;
 padding-top: 5px;
 padding-right: 5px;
 padding-bottom: 0px;
 padding-left: 5px;
}
-->
</style>
<script language="javascript">
var k;
function showHideResp(k)
{
 if(k=='one'){
document.getElementById('oneTextResp').style.display='';
document.getElementById('twoTextResp').style.display='none';
document.getElementById('threeTextResp').style.display='none';
}
 if(k=='two'){
document.getElementById('oneTextResp').style.display='none';
document.getElementById('twoTextResp').style.display='';
document.getElementById('threeTextResp').style.display='none';
}
if(k=='three'){
document.getElementById('oneTextResp').style.display='none';
document.getElementById('twoTextResp').style.display='none';
document.getElementById('threeTextResp').style.display='';
}

}
</script>
</head>
<body >

<table >
<tr>
<td>
<table>
<tr>
<td>
<A id="one"  href="#" onmouseover="showHideResp('one')">
<img
src="https://km.ca.com/rnd/MyTeams/buops/lodcommunity/PublishingImages/challengeBox.JPG" ></A>
</td>
<td>
<div id="oneTextResp" style="display:none; text-align:left"   class="hoverTextResp">
<img
src="https://km.ca.com/rnd/MyTeams/buops/lodcommunity/PublishingImages/challengeArrow.JPG" ></div>
</td>
</tr>
<tr>
<td>
<A id="two"  href="#" onmouseover="showHideResp('two')">
<img
src="https://km.ca.com/rnd/MyTeams/buops/lodcommunity/PublishingImages/ResponseBox.JPG" ></A>
</td>
<td>
<div id="twoTextResp" style="display:none; text-align:left"   class="hoverTextResp">
<img
src="https://km.ca.com/rnd/MyTeams/buops/lodcommunity/PublishingImages/ResponseArrow.JPG" ></div>
</td>
</tr>
<tr>
<td>
<A id="three"  href="#" onmouseover="showHideResp('three')">
<img
src="https://km.ca.com/rnd/MyTeams/buops/lodcommunity/PublishingImages/ResultBox.JPG" >
</A>
</td>
<td>
<div id="threeTextResp" style="display:none; text-align:left"   class="hoverTextResp">
<img
src="https://km.ca.com/rnd/MyTeams/buops/lodcommunity/PublishingImages/ResultArrow.JPG" >
</div>
</td>
</tr>
</table>

</td>
<td>
<img
src="https://km.ca.com/rnd/MyTeams/buops/lodcommunity/PublishingImages/greyBox.JPG" >
</td>

<tr>
</table>
</body>

Thursday, July 28, 2011

Steps to Embedding Power Point(.ppt) presentation in SharePoint page

Follow the below steps to embedding power point presentation in share point page.

Step-1: Open ppt file in local machine and save as single webpage(.mht)
Step-2: Open share point site and upload this file (.mht) in to a document library.
Step-3: Copy the url of the file from document library.
Step-4: Create a page and place "page viewer web part" and give the above copied url in web part configuration.
Strp-5: Finally we will able to see power point presentation in share point page.


Advantages: There is no need to have client software of ppt installed in end user's machine.

Monday, July 18, 2011

Play video files (youTube etc) files in sharepoint

Place the following code in content Editor Webpart

 <object width="380" height="385">
                    <param name="movie" value="http://www.youtube.com/v/i5VDAx1xD3E123&hl=en_GB&fs=1&rel=0&color1=0x2b405b&color2=0x6b8ab6"></param>
                   <param name="allowFullScreen" value="true"></param>
                   <param name="allowscriptaccess" value="always"></param>
                   <embed src="http://www.youtube.com/v/i5VDAx1xD3E123&hl=en_GB&fs=1&rel=0&color1=0x2b405b&color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="650" height="385"></embed>
               </object>

Wednesday, April 6, 2011

Easy TABs code of Web part zone

Moss 2007 Easy TABs code of Web part zone

In a web part zone add “content editor web part” and paste the following code and make it as hidden web part.

<script id="EasyTabsScript" type="text/javascript">
var TabCookie = "TabCookie" + window.location.pathname;

function GetParentTable(elem)
{
while(elem !=null && elem.tagName !="TABLE") elem=elem.parentNode;
return elem;
}

function activateTab(selectedtab) {
if (WPzone.id != "MSOZone") {
var allTabs = document.getElementById("EasyTabs").getElementsByTagName("SPAN");
for (i=0;i<allTabs.length;i++) {
var WPCellID = allTabs[i].id.replace(/tab/,"MSOZoneCell_");
var TitleID = allTabs[i].id.replace(/tabWebPartWPQ/,"WebPartTitleWPQ");
if (allTabs[i] == selectedtab) {
allTabs[i].className = "ms-tabselected";
document.getElementById(WPCellID).parentNode.style.display = "";
document.getElementById(TitleID).parentNode.style.display = "none";
}
else {
allTabs[i].className = "ms-tabinactive";
document.getElementById(WPCellID).parentNode.style.display = "none";
}
}
}
}

function BuildEasyTabs(){

var TabsTD = document.createElement("TD");
TabsTD.className = "ms-siteactionsmenu";
TabsTD.id = "EasyTabs";

var SeparatorTD = document.createElement("TD");
SeparatorTD.style.height = "5px";
SeparatorTD.className = "ms-pagetitleareaframe";

var theDIVs = WPzone.getElementsByTagName("DIV");
for (i=0;i<theDIVs.length;i++) {
if (theDIVs[i].className.indexOf("ms-PartSpacing")==0) {
theDIVs[i].style.display="none";
}
if ((theDIVs[i].id.indexOf("WebPartWPQ")==0) && (GetParentTable(theDIVs[i]).style.display!="none")) {
var TitleID = theDIVs[i].id.replace(/WebPartWPQ/,"WebPartTitleWPQ");
var NewSPAN = document.getElementById(TitleID).getElementsByTagName("SPAN")[0].cloneNode(true);

NewSPAN.className = "ms-tabinactive";
NewSPAN.style.height = "18px";
NewSPAN.id = "tab" + theDIVs[i].id ;
NewSPAN.onclick = function() {SetCookie(TabCookie,this.id,"/");activateTab(this);}
TabsTD.appendChild(NewSPAN);

}
}

WPzone.insertRow(0);
WPzone.rows[0].appendChild(SeparatorTD);
WPzone.insertRow(0);
WPzone.rows[0].appendChild(TabsTD);

if (GetCookie(TabCookie)!= null) {var ActiveTab = document.getElementById(GetCookie(TabCookie));}
else {var ActiveTab = TabsTD.getElementsByTagName("SPAN")[0];}

activateTab(ActiveTab);
}

var WPzone = GetParentTable(GetParentTable(document.getElementById("EasyTabsScript")).parentNode);

_spBodyOnLoadFunctionNames.push('BuildEasyTabs');

</script>

Monday, February 21, 2011

How to hide left side quick naviagation

&lt style &rt
.ms-navframe {
display:none;
}
 &lt /style &rt


Place this code in Content Editor Webpart of the same page

How to hide left side quick naviagation