none
Failed to load viewstate

    Question

  • Hello:

    Ive got a UserControl (data Entry form). Within it ive got HTML Tables all of which have questions .
    I want to bring the questions that were missed up on top of the html table. Alls working fine if its an .aspx. The code to do the row manipulation is fione,But i get the above error message (in the subject) when its in a control .ascx which is being loaded in a page.

    Pls advise how to tackle this situation.

    Thank you
    Thursday, April 27, 2006 8:14 PM

Answers

All replies

  • Is your user control overriding SaveViewState and LoadViewState?

    Can you paste the whole Stack Trace exception?

    Thursday, April 27, 2006 9:38 PM
    Moderator
  • [HttpException (0x80004005): 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.]
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
       System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +291
       System.Web.UI.ControlCollection.Add(Control child) +153
    
    System.Web.UI.Control.OnLoad(EventArgs e) +67
       System.Web.UI.Control.LoadRecursive() +35
       System.Web.UI.Page.ProcessRequestMain() +750
    Friday, April 28, 2006 5:32 PM
  • Is your user control overriding SaveViewState and LoadViewState?

    Tuesday, May 02, 2006 2:43 PM
    Moderator
  • Hi!

    I can't give you more help without more info, but I would pop over to the ASP.NET forums as you'll likely find more info there.

    The best place for asking ASP.NET questions is on the ASP.NET community site, and in the forums there. Check out http://www.asp.net/welcome.aspx?tabindex=1&tabid=39.

    HTH,

    PEte

    Tuesday, May 02, 2006 4:39 PM
    Moderator