J
Jarod
Hey
I change backColor of linkButton in my Page_Load:
lbDoSth.BackColor = Color.Red;
But I have multiView on this page. On one of the views I have detailsView.
When I add a new row a set Visible = false on this detailsView. And rebound
appropriate gridView. Then I press the button and I have 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
How should I persist the backColor of the linkButton ? The problem is only
after Inser/Edit in detailsView and re-bound of controls.
Jarod
I change backColor of linkButton in my Page_Load:
lbDoSth.BackColor = Color.Red;
But I have multiView on this page. On one of the views I have detailsView.
When I add a new row a set Visible = false on this detailsView. And rebound
appropriate gridView. Then I press the button and I have 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
How should I persist the backColor of the linkButton ? The problem is only
after Inser/Edit in detailsView and re-bound of controls.
Jarod