DekGenius.com
[ Team LiB ] Previous Section Next Section

StateItem

System.Web.UI (system.web.dll)sealed class

This class represents an item in the StateBag collection and is used to track changes to that item. The actual stored object is contained in the Value property. An additional piece of information is provided in the IsDirty property, which is True if the item has been changed since being saved into the StateBag collection. Changes to an item in the StateBag are saved when the ASP.NET framework calls the Control.SaveViewState( ) method.

When you retrieve an option from the StateBag collection using the default indexer StateBag.Item, you will receive the actual object. If, however, you want to enumerate through the StateBag collection using for each syntax, you should create a StateItem enumerator. You can also retrieve a StateItem object from the StateBag.Add( ) method.

public sealed class StateItem {
// Public Instance Properties
   public bool IsDirty{set; get; }
   public object Value{set; get; }
}

Returned By

StateBag.Add( )

    [ Team LiB ] Previous Section Next Section