FormView / DetailsView and &quot;Failed to load viewstate..&quot;
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!