This documentation is archived and is not being maintained.

StateBag Members

StateBag overview

Public Constructors

public constructorStateBag Constructor Overloaded. Initializes a new instance of the StateBag class.

Public Properties

public propertyCount Gets the number of StateItem objects in the StateBag object.
public propertyItem Gets or sets the value of an item stored in the StateBag object.

In C#, this property is the indexer for the StateBag class.

public propertyKeys Gets a collection of keys representing the items in the StateBag object.
public propertyValues Gets a collection of the view-state values stored in the StateBag object.

Public Methods

public methodAdd Adds a new StateItem object to the StateBag object. If the item already exists in the StateBag, it updates the value of the item.
public methodClear Removes all items from the current StateBag object.
public methodEquals (inherited from Object) Overloaded. Determines whether two Object instances are equal.
public methodGetEnumerator Returns an enumerator that iterates over all the key/value pairs of the StateItem objects stored in the StateBag.
public methodGetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
public methodGetType (inherited from Object) Gets the Type of the current instance.
public methodIsItemDirty Checks a StateItem object stored in the StateBag to evaluate if it has been modified since the call to Control.TrackViewState.
public methodRemove Removes the specified key/value pair from the StateBag object.
public methodToString (inherited from Object) Returns a String that represents the current Object.

Protected Methods

protected methodFinalize (inherited from Object) Overridden. Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.

In C# and C++, finalizers are expressed using destructor syntax.

protected methodMemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

StateBag Class | System.Web.UI Namespace