dynamic controls: viewstate & web control tree
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.
Let's say I have 1 page with a DataList for editing...it contains 2 labels
that are set to values from the database, firstname and lastname. When a
button is clicked we go into editmode, where we see 2 textboxes instead of
labels. The user fills out the values and then presses enter. The error
above pops up.
Does this error mean that I have to create the 2 labels and 2 textboxes on
the first page with Visible=False values for the textboxes to avoid this
error? Since the error says the control tree must match, I'm guessing that
the controls have to be exactly alike on both pages while we control their
viewability with the visible=false/true property.
Is this how it must be done? Let me know plz, thanks.
|All times are GMT. The time now is 04:00 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.