Friday, May 14, 2010

SharePoint WebParts and Ajax UpdatePanel issue

Currently working on an ASP.NET user control that is running in a SharePoint web site. The user control is hosted inside of a SharePoint web part. One of the requirements was that the page have a better user experience on one particular call that took upwards of 15 seconds to complete.

So my solution was to use a ASP.NET Ajax UpdatePanel and UpdateProgress controls to do so. Problem that I saw was the page worked great for the first postback, but then the page was for the most part dead in the water, and would not post back again. I searched for about 2 full days to fix the problem. Part of that time was actually because I was kind of misdiagnosing the issue, but I finally stumbled upon this script. I added it to my control, and everything worked great. So I hope this helps someone else:)

Wrap in some javascript tags, and you should be good to go...

_spOriginalFormAction = document.forms[0].action;
_spSuppressFormOnSubmitWrapper=true;