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>