By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,386 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Viewstate error when adding user controls

P: n/a
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.
Jun 9 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Jun 9, 1:35 pm, "Chris" <nos...@nospam.comwrote:
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/micro...d+viewstate%22

Jun 9 '07 #2

P: n/a
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" <al************@gmail.comwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
On Jun 9, 1:35 pm, "Chris" <nos...@nospam.comwrote:
>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/micro...d+viewstate%22

Jun 9 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.