Posted by: jwalin on: February 3, 2009
When authoring a custom ASP.NET control, I believe it a best practice to store public properties in the control’s viewstate. This applies to both controls inheriting from WebControl and to user controls.
[System.ComponentModel.DefaultValue("MyDefault")]
public string MyProperty
{
get { return ViewState["MyProperty"] as string ?? “MyDefault”; }
[...]