Welcome to weblogs.com.pk Sign in | Join | Help

FormView / DetailsView and "Failed to load viewstate.."

This took considerable time to fix!

Gotcha: If a page hides and unhidesDetailsView/FormView controls, it may produce a bogus “Failed to load viewstate…” error message
 
Fix: Set “EnableViewState” property to False for each of the DetailsView/FormView controls

Even if you wrap the FormView in some Panel and tries to set its visibility; same behavior is seen, if you set the EnableViewState to false; and your formview template has some control (say drop down list); you wil have unexpected behavior due to the fact that formview is not persisting the things into view state..

Simplest workaround is; that you keep any one template of FormView as emtpy and set it as its default mode and then simply change the mode where requires!

Published Thursday, August 24, 2006 10:59 PM by khurram
Filed under:

Comments

No Comments

New Comments to this post are disabled