Friday 27 March 2009

Common Errors with Solutions in Sharepoint

While working with share point many a times we face various errors and then we have no clue about what to do ...

so i thought of putting down few of day to day errors with probable solutions to them ..


1. Error : "File Not Found"

Usually this error comes if the page is trying to get reference of some assembly or dependency and not able to get that . You can also receive this error if some thing went wrong in web.config

Solutions : Open the file and check for any invalid entries of references. You can then try with web.config If you find something like this

xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"

delete it ..

Also you can check for invalid "?" entries in web.config and trying removing them .

2. All famous .. "Unknown Error " . It can mean many things ... Few readings

http://support.microsoft.com/kb/556031

Though you can get many options to select from but i would suggest the best way to deal with this is (incase its on Dev Env only) go to web.config

change to CustomErrors = Off and CallStack= true

This in most of the cases will give you good enough information about the error

3. "401 Unauthorized" on Sign In on form authentication. Some reading

http://www.codeplex.com/MOSSFormsFeature/Thread/View.aspx?ThreadId=9702

usually people call it as a bug but in my case it came few times because of my few tweaks tests in global.asax or httphandlers .

4. "An unexpected error has occurred" : again this is very common error .again best way to find solution to this is follow changes in web.config given in point 2

5. "This page has encountered a critical error. Contact your system administrator if this problem persists. " ...90% cases atleast with me for this error has been invalid entry of "?" in web.config

6. Another of error we face is with regards to webpart ...to remove unwanted webparts from the page incase page is throwing error . eg on Default.aspx
add Default.aspx?contents=1 ..this will open webpart maintenance page where you can delete the unwanted webpart and bring back the page

7. “The server could not complete your request. Contact your internet service provider or Web server administrator to make sure that the server has the Frontpage Server Extensions or SharePoint Services installed.” ...This you might face while opening some file in sharepoint designer ... there can many ways to solve this .. some of them which i try ... 1 close the site and open again from sharepoint designer 2. do iisreset or recycle the pool 3. check for versions of assemblies referenced ...

Will try to post 2nd round of error list with probable solutions. Hope this helps !!!

Monday 16 March 2009

Update Panel in Publishing Site Template

Lately i was trying my hands on Ajax based webpart on Publishing Site and faced problem withUpdatePanel . Page does a partial Postback but controls are not rendered properly .Example Scenario :
UpdatePanel
____________button
______________Label

button have event to update label .. .. now in this case button event happens but label text doesnt get updated . This only happens in Publishing Site Template and works fine in other site templates .How to Solve :

Open Masterpage and replace following

"
<body class="body" onload="javascript:_spBodyOnLoadWrapper();">
<WebPartPages:SPWebPartManager runat="server"/>
<form runat="server" onsubmit="return _spFormOnSubmitWrapper();">
"

with

"
<BODY scroll="yes" class="rly-body" onload="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">
<form runat="server" onsubmit="return _spFormOnSubmitWrapper();">

<WebPartPages:SPWebPartManager ID="SPWebPartManager1" runat="server"/>
"

Hopefully this will make it work
Enjoy !!