473,396 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Failed to load viewstate error

Hi,

We have an ASP.net application, where we dynamically add controls, in the
Page_Load. Occasionally, when the user posts back the page (e.g. clicks Save
button on the page), we get a "Failed to load viewstate" error. This happens
on Windows Server 2003. It happens erratically, and appears to happen after
the application has been running (and in use) for some time. When the
problem arises, it appears to happen more frequently for a while, then
everything works perfectly for another long period...and so on.

We have not been able to re-produce the error on an XP pc yet (so not sure
if it is OS dependant, or some other issue).

The dynamically-added controls are always added in the same order, in the
Page_Load.

Any suggestions would be much appreciated.

Regards,

Eamonn.


Jul 21 '05 #1
3 2951
Hi Eamonn,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you're getting a "Failed to load
viewstate" error occasionally. If there is any misunderstanding, please
feel free to let me know.

Based on my research, this error might occur when you have some 3rd-party
control on the ASP.NET page. So could you let me know what version of
ASP.NET you're using and what control you're adding dynamically?

Thanks.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2
Hi Kevin,

Yes, we are getting a "Failed to load viewstate" error occasionally.
The exact error is as follows:

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.Control.LoadViewStateRecursive(Objec t savedState)
at System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState)
at System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState)
at System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState)
at System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState)
at System.Web.UI.Control.LoadViewStateRecursive(Objec t savedState)
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at System.Web.UI.ControlCollection.Add(Control child)
at OC_WebControls.TocControlContainer.CreateControls( ResourceManager
LocRM, WebControlFactory ControlFactory, DataRow[] Rows, Hashtable
htParentControls)
at Jupiter.RunTimeForm.ConstructFormView(DataSet dsScreenDefinition)
at Jupiter.RunTimeForm.Page_Load(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain()

There are many controls on the form, mostly dot net controls including
textboxes, labelse, checkboxes, htmlimage, hidden field, combo, etc...but
also UltraWebGrig and UltraWebTab from Infragistics.
The problem is diffiult to reproduce using the debug version of the
application so we havn't pin pointed which control has the problem. (I will
put in a try...catch which throws an error idenitifying the control name and
test a 'Release' version.)

The problem arrises after the site has been used for some time, then
frequently occurrs, then disappears for a long time, only to reappear later.

We are using .Net Framework version 1.1.4322

Any assistance you can provide is appreciated.
Regards,
Eamon.

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:B4**************@TK2MSFTNGXA01.phx.gbl...
Hi Eamonn,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you're getting a "Failed to load
viewstate" error occasionally. If there is any misunderstanding, please
feel free to let me know.

Based on my research, this error might occur when you have some 3rd-party
control on the ASP.NET page. So could you let me know what version of
ASP.NET you're using and what control you're adding dynamically?

Thanks.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3
Hi Eamonn,

Thanks for your reply. This error seems to have something to do with the
UltraWebGrid. I have found similar issue using this control and get the
same problem as you do.

To isolate the problem, we can try to remove the 3rd-party control and see
if the problem can be reproed. I would suggest you try to contact the
control vendor to see if there is a workaround. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
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...
1
by: et | last post by:
I. 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...
1
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...
3
by: Eamonn O'Connell | last post by:
Hi, We have an ASP.net application, where we dynamically add controls, in the Page_Load. Occasionally, when the user posts back the page (e.g. clicks Save button on the page), we get a "Failed...
1
by: rockdale | last post by:
Sometime my ASP.NET application got this error message but not always everytime. Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that...
6
by: sck10 | last post by:
Hello, I have applications that produce the following error when they have been open to long without activity. Is there any way to force a re-load of the page or go to another page if the page...
4
by: scottcly | last post by:
I have a simple editor with a Gridview and a DetailsView. The Gridview handles DELETE and the DetailsView handles UPDATE and ADD. A panel around each one and some minor event handling is used to...
2
by: sck10 | last post by:
Hello, I have a web page that has a GridView and a FormView, each in its own panel. The GridView shows a list of records in a database. When a row in the GridView is selected the FormView...
0
by: nithagowda | last post by:
Hello, I have a DropDownList for source type and a panel for displaying TreeView based on the source type.. The problem is- if i select different source type drom ddlSrcType, other than the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.