Ajax Enabled Webparts in MOSS: Work Arounds

Error Message:
Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

Solution:
Disabled the view state for control.
this.[ControlName].EnableViewState = false;

 


Error Message:
Script controls may not be registered before PreRender.

Solution:
Added a reference of Script Manager to the current Master Page.
     Add to the top of the Master Page: <%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" Namespace="System.Web.UI" TagPrefix="asp" %>

Added <asp:Scriptmanager/> right below the <WebPartPages/> in the master page.
     Look for in the Master Page: <WebPartPages:SPWebPartManager id="m" runat="Server"/>
     Add: <asp:ScriptManager ID="scriptManager1" runat="server"></asp:ScriptManager>


Print | posted @ Saturday, July 05, 2008 5:10 PM

Comments on this entry:

Gravatar # re: Ajax Enabled Webparts in MOSS: Work Arounds
by Dude at 10/9/2008 11:24 AM

It's works !!!

Thanks a lot !!!
Gravatar # re: Ajax Enabled Webparts in MOSS: Work Arounds
by Eugene Kochkin at 10/31/2008 8:34 AM

Thanks a lot Wayne. It works for me also. :)
Gravatar # re: Ajax Enabled Webparts in MOSS: Work Arounds
by Mathi at 1/5/2009 3:13 AM

I had to modify the version to suit our server's assembly.
And, I also had to make sure that this scriptmanager tag is added within a < form > tag.

works well for me.. thnx!!!
Gravatar # re: Ajax Enabled Webparts in MOSS: Work Arounds
by Roman at 10/11/2010 3:42 PM

You are the man. Saved me a lot of time. Thanks!!!
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: