SharePoint, AJAX UpdatePanel and SPWebPartManager woes

26 01 2010

If you are having trouble getting your AJAX UpdatePanel to update properly in a SharePoint page or Web Part then you have come to the right place. You may already be aware that to get an UpdatePanel working in SharePoint you need to add a an additional function to your code that alters the _spFormOnSubmitWrapper and the _spSuppressFormOnSubmitWrapper. See here for an example –

http://petesullivan.wordpress.com/2008/06/13/ajax-update-panels-and-sharepoint/

However!! If you are using a custom Master Page then watch out because there is another gotcha!

It seems that if the SPWebPartManager tag appears before the Form tag in your master page then your updatepanel will not update properly and most likely wonโ€™t display any content. This should be changed so the SPWebPartManager tag appears underneath the form tag, see below for an example –

Incorrect

<WebPartPages:SPWebPartManager ID="SPWebPartManager1" runat="server"/>   
<form id="Form1" runat="server" onsubmit="return _spFormOnSubmitWrapper();">

Correct

<form id="Form1" runat="server" onsubmit="return _spFormOnSubmitWrapper();">
<WebPartPages:SPWebPartManager ID="SPWebPartManager1" runat="server"/>

Hope this helps! ๐Ÿ™‚





Enabling .NET 3.5 support in your SharePoint environment – ‘The easy way’

19 01 2010

I used enable this support manually i.e. opening up the web.config file and making the necessary changes. I felt that this was a safer way to ensure that nothing went wrong. Recently though I have found a much better way to do this โ€“ Jan Tielens has a blog post on how to enable .NET 3.5 in SharePoint by using Visual Studio to modify the web.config for you, it works very well and is really quick to do.

You can find his blog post here –

http://weblogs.asp.net/jan/archive/2008/10/10/enabling-net-3-5-in-sharepoint-2007-sites-the-lazy-way.aspx

Thanks Jan!  (@jantielens on Twitter)