Viewstate error when adding user controls

Discussion in 'ASP .Net' started by Chris, Jun 9, 2007.

  1. Chris

    Chris Guest

    I am getting a viewstate error when adding dynamically user controls.

    SYSTEM_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.

    My understanding is that the information about the controls getting posted
    back has to match the controls being created. When they don't match, this is
    what creates the error. The main solution I have seen is to add all the user
    controls and use visability to swap bewteen them. My page could have 14 user
    controls. Will this add a massive performance hit to the page? Are there any
    alternative approaches. Regards, Chris.
     
    Chris, Jun 9, 2007
    #1
    1. Advertising

  2. On Jun 9, 1:35 pm, "Chris" <> wrote:
    > I am getting a viewstate error when adding dynamically user controls.
    >
    > SYSTEM_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.
    >
    > My understanding is that the information about the controls getting posted
    > back has to match the controls being created. When they don't match, this is
    > what creates the error. The main solution I have seen is to add all the user
    > controls and use visability to swap bewteen them. My page could have 14 user
    > controls. Will this add a massive performance hit to the page? Are there any
    > alternative approaches. Regards, Chris.


    http://groups.google.com/group/micr...framework.aspnet&q="Failed to load viewstate"
     
    Alexey Smirnov, Jun 9, 2007
    #2
    1. Advertising

  3. Chris

    Chris Guest

    I've tried adding explicit id's and I don't want to turn the viewstate off.
    I kind of understand sort of why it is happening was just wonder whether
    there was a straight forward and efficient solution.

    "Alexey Smirnov" <> wrote in message
    news:...
    > On Jun 9, 1:35 pm, "Chris" <> wrote:
    >> I am getting a viewstate error when adding dynamically user controls.
    >>
    >> SYSTEM_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.
    >>
    >> My understanding is that the information about the controls getting
    >> posted
    >> back has to match the controls being created. When they don't match, this
    >> is
    >> what creates the error. The main solution I have seen is to add all the
    >> user
    >> controls and use visability to swap bewteen them. My page could have 14
    >> user
    >> controls. Will this add a massive performance hit to the page? Are there
    >> any
    >> alternative approaches. Regards, Chris.

    >
    > http://groups.google.com/group/micr...framework.aspnet&q="Failed to load viewstate"
    >
     
    Chris, Jun 9, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sinisa Ruzin
    Replies:
    0
    Views:
    888
    Sinisa Ruzin
    Oct 7, 2004
  2. Replies:
    4
    Views:
    439
    Patrice
    Mar 30, 2006
  3. Faizan Ahmed
    Replies:
    1
    Views:
    311
    John Saunders
    Jan 4, 2005
  4. error in adding user controls at runtime

    , Mar 30, 2006, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    200
    Patrice
    Mar 30, 2006
  5. error in adding user controls at runtime

    , Mar 30, 2006, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    180
    Patrice
    Mar 30, 2006
Loading...

Share This Page