System.Web.HttpUnhandledException: Failed to load viewstate
Event:
Getting error while loading control - the GridView in CreateChildControl that uses ViewState
Error:
The solution:
Transfer the load of the ViewState to PreRender (from CreateChildControl)
The lesson:
Better understand the life-sycle of loading (seems that no matter the experience, are always making mistakes of a beginner :) ...)
Cheers,
Roi
Getting error while loading control - the GridView in CreateChildControl that uses ViewState
Error:
System.Web.HttpUnhandledException: 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.
The solution:
Transfer the load of the ViewState to PreRender (from CreateChildControl)
The lesson:
Better understand the life-sycle of loading (seems that no matter the experience, are always making mistakes of a beginner :) ...)
Cheers,
Roi
Comments
Post a Comment