AjaxControlToolkit has methods to access ViewState:
AjaxControlToolkit
ViewState
protected V GetPropertyValue<V>(string propertyName, V nullValue) { if (this.ViewState[propertyName] == null) { return nullValue; } return (V) this.ViewState[propertyName]; } protected void SetPropertyValue<V>(string propertyName, V value) { this.ViewState[propertyName] = value; } ... public bool EnabledOnClient { get { return base.GetPropertyValue("EnabledOnClient", true); } set { base.SetPropertyValue("EnabledOnClient", value); } }
We find that code unnecessary complex and nonoptimal. Our code to access ViewState looks like this:
public bool EnabledOnClient { get { return ViewState["EnabledOnClient"] as bool? ?? true); } set { ViewState["EnabledOnClient"] = value; } }
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u