473,598 Members | 3,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Viewstate error when adding user controls

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

SYSTEM_EXCEPTIO N: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
2 1944
On Jun 9, 1:35 pm, "Chris" <nos...@nospam. comwrote:
I am getting a viewstate error when adding dynamically user controls.

SYSTEM_EXCEPTIO N: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
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.goo glegroups.com.. .
On Jun 9, 1:35 pm, "Chris" <nos...@nospam. comwrote:
>I am getting a viewstate error when adding dynamically user controls.

SYSTEM_EXCEPTI ON: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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4880
by: theo | last post by:
Hi... I wish to extract the text content of an Xml file and assign it to DropDownList controls at runtime.I can get the Xml file text content into the DropDownList controls (Ex...if 5 Xml text tags then 5 dropdownlist controls each containing the 5 Xml text tags). Problem,when I save the user DropDownList selected items by means of a button click the web form looses the PlaceHolder viewstate and generates the following error..."Object...
9
21634
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter the results in the grid. Say you filter the grid for records that have a certain condition set to "NO" (in this case a checkbox). In this scenario the search returns one result. If I then check the checkbox ("YES") and save it, I now get my message...
1
3451
by: Tim | last post by:
Greetings! I have a UserControl. On this UserControl is a Panel and a RadioButtonList. The Panel's Visible property is set to false by default. When the user selects a particular RadioButtonList value, a postback is performed and the Panel's Visible property is set to true. Selecting a different RadioButtonList value sets the Visible property to false again. So far, so good. It does, in fact, do this.
10
3075
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web config does specify a machinekey setting: <machineKey validationKey="447C05E8B3A71401CC4CAE5513A7F1A3494A3618EE819316AAD1D58433F236A759D66FB4154500E01EB4E1BC1DE42046E2D652D391CB8367A1649438867A02EB"...
0
7987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8397
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8050
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8264
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
3897
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3939
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2412
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1250
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.