System.Web.UI.StateBag Class

Manages the view state of ASP.NET server controls, including pages. This class cannot be inherited.

See Also: StateBag Members

Syntax

public sealed class StateBag : IDictionary, IStateManager

Remarks

View state for a page or control is the cumulative property values, or view, of that page or control. You can access this class through the Control.ViewState property. Controls can also store essential state information in control state, but that information is not stored as a System.Web.UI.StateBag object.

This class is the primary storage mechanism for all HTML and Web server controls. It stores attribute/value pairs as strings associated with the control. It tracks changes to these attributes only after the Control.OnInit(EventArgs) method is executed for a page request, and saves the changes to the page's or control's view state.

This class implements a dictionary, and you can add items to it or remove items from it as you would any dictionary object. For more information about data collections, such as dictionaries, see Collections and Data Structures.

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0