Failed to load viewstate

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sanjay Pais

    Failed to load viewstate

    We keep getting this error on one of our web pages. I have absolutely no
    idea which control is causing the problem. How do i diagnose and fix this
    problem?



    It has been driving us nuts!



    Thanks



    Sanjay



    System.Web.Http Exception: 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.

    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)

    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)

    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)

    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)

    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)

    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)

    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)

    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)

    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)

    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)

    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)

    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)

    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)

    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)

    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)

    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)

    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)

    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)

    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)

    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)

    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)

    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)

    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)

    at System.Web.UI.P age.LoadAllStat e()

    at System.Web.UI.P age.ProcessRequ estMain(Boolean
    includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)




  • Cowboy \(Gregory A. Beamer\)

    #2
    Re: Failed to load viewstate

    Essentially, the framework pulls the viewstate and starts matching controls
    to their viewstate values. You might then have new values from the submit,
    which overrides these values. Then viewstate is reset.

    By design, it fails if it has a value that does not match a control. This is
    most common with dynamically added controls. That leads to this question:

    Are you using dynamically added controls? If so, you have to place them on
    the page before ViewState is pulled by the CLI ... IF they use viewstate on
    these controls, that is.

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog


    or just read it:


    *************** *************** *************** ****
    | Think outside the box!
    |
    *************** *************** *************** ****
    "Sanjay Pais" <sdpais@athotma ildot.comwrote in message
    news:uQH9p9ruIH A.4952@TK2MSFTN GP05.phx.gbl...
    We keep getting this error on one of our web pages. I have absolutely no
    idea which control is causing the problem. How do i diagnose and fix this
    problem?
    >
    >
    >
    It has been driving us nuts!
    >
    >
    >
    Thanks
    >
    >
    >
    Sanjay
    >
    >
    >
    System.Web.Http Exception: 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.
    >
    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)
    >
    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)
    >
    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)
    >
    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)
    >
    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)
    >
    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)
    >
    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)
    >
    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)
    >
    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)
    >
    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)
    >
    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)
    >
    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)
    >
    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)
    >
    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)
    >
    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)
    >
    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)
    >
    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)
    >
    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)
    >
    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)
    >
    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)
    >
    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)
    >
    at System.Web.UI.C ontrol.LoadChil dViewStateByInd ex(ArrayList childState)
    >
    at System.Web.UI.C ontrol.LoadView StateRecursive( Object savedState)
    >
    at System.Web.UI.P age.LoadAllStat e()
    >
    at System.Web.UI.P age.ProcessRequ estMain(Boolean
    includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)
    >
    >
    >
    >

    Comment

    Working...