472,978 Members | 2,142 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,978 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 2918
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.