Name

StateItem

Synopsis

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 NotInheritable Class StateItem
                  ' Public Instance Properties
   Public Property IsDirty As Boolean  
   Public Property Value As Object  
End Class

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.