R
R Reyes
Hi,
The question I'm asking revolves around what is needed to load a viewstate.
1) I am using Regular Expression Validators to validate text fields on a page.
--Let's say I have a form set up. After I type in "bad data" in a date
field and click submit, the validators will show up correctly with the errors
I programmed in red saying bad data was entered.
--Now, when I click on submit again (or even the back button) after
correcting the dates, I get the "Failed to load viewstate" error.
I've tried setting EnableViewState to both true and false but they don't
make a difference. Tutorials online are not helpful either as I think they
go into too much explanation about what a viewstate is, rather than how to
debug this common problem that I can't seem to get past.
I've coded a decent sized application for modifying Employee data and I
can't get passed this error. I'm not about to start from scratch
either...Can someone explain to me how I can stop this from happening?
Here is the stack trace (which I am also not very good at figuring out):
[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) +343
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +142
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +290
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +142
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +290
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +142
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +290
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +142
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +290
System.Web.UI.Page.LoadAllState() +527
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3940
Please help and post any comments as to what I'm doing wrong. Thanks in
advance.
The question I'm asking revolves around what is needed to load a viewstate.
1) I am using Regular Expression Validators to validate text fields on a page.
--Let's say I have a form set up. After I type in "bad data" in a date
field and click submit, the validators will show up correctly with the errors
I programmed in red saying bad data was entered.
--Now, when I click on submit again (or even the back button) after
correcting the dates, I get the "Failed to load viewstate" error.
I've tried setting EnableViewState to both true and false but they don't
make a difference. Tutorials online are not helpful either as I think they
go into too much explanation about what a viewstate is, rather than how to
debug this common problem that I can't seem to get past.
I've coded a decent sized application for modifying Employee data and I
can't get passed this error. I'm not about to start from scratch
either...Can someone explain to me how I can stop this from happening?
Here is the stack trace (which I am also not very good at figuring out):
[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) +343
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +142
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +290
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +142
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +290
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +142
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +290
System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState) +142
System.Web.UI.Control.LoadViewStateRecursive(Object savedState) +290
System.Web.UI.Page.LoadAllState() +527
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3940
Please help and post any comments as to what I'm doing wrong. Thanks in
advance.