Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   dynamic controls: viewstate & web control tree (http://www.velocityreviews.com/forums/t777114-dynamic-controls-viewstate-and-web-control-tree.html)

R Reyes 11-01-2005 04:06 PM

dynamic controls: viewstate & web control tree
 
Error:
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.

Question:
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 05:06 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.