What happens to custom control properties that save their values in the ViewState when the ViewState is disabled for that control?
Example:
public string ID
{
get
{
object o = ViewState["ID"];
return (o != null ? o.ToString() : String.Empty);
}
set { ViewState["ID"] = value; }
}
Obviously you can still get the value from the ID property when the ViewState is disabled. But I'm curious to how that works and where it's storing the value in that case.
mr_breaker
Member
320 Points
187 Posts
Storing control properties in the ViewState
Mar 27, 2007 08:52 PM|LINK
Hi,
What happens to custom control properties that save their values in the ViewState when the ViewState is disabled for that control?
Example:
public string ID { get { object o = ViewState["ID"]; return (o != null ? o.ToString() : String.Empty); } set { ViewState["ID"] = value; } }Obviously you can still get the value from the ID property when the ViewState is disabled. But I'm curious to how that works and where it's storing the value in that case.