Friday, March 11, 2011
How to deal with 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.
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.
Do not add same kind user control twice with different name into same placeholder if Viewstate is Enabled
Weird bug, how to handle dynamically loaded user control events not firing on first click
For every usercontrol, need to set ID property before adding. And don’t use Guid
Control ctl = this.LoadControl("usercontrol.ascx");
ctl.ID = "ctl" + i.ToString();
Panel1.Controls.Add(ctl);
Subscribe to:
Posts (Atom)