Exception

J

Jarod

I got following expeption:
Always when I try to update gridView using detailsView on the SECOND time.
So I made 1 update, and I try to make another one and than boom... I don't
add any controls dynamically its' pretty simple detailsView. But gridView
and detailsView are in View control is it a problem ? I don't make anything
with it. On the whole page I don't add anything dynamically all what's done
in my code is setting Visisble / true / false in detailsView and than I
dataBind() on gridView. So why do I get 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. 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.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: 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.

Source Error:


An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.


Stack Trace:


[HttpException (0x80004005): 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.]
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +484
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
+195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +425
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
+195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +425
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
+195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +425
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
+195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +425
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
+195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +425
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
+195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +425
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
+195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +425
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
+195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +425
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
+195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +425
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
+195
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +425
System.Web.UI.Page.LoadAllState() +558
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2238





--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.42

Jarod
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top