StateBag::Item Property
Gets or sets the value of an item stored in the StateBag object.
Assembly: System.Web (in System.Web.dll)
public: property Object^ Item[String^ key] { Object^ get (String^ key); void set (String^ key, Object^ value); }
Parameters
- key
- Type: System::String
The key for the item.
Using this member is the simplest way to save and retrieve view-state values for a control or a page.
If an item is not already stored in the StateBag object when you set this property, its key/value pair is added to the collection. If you set this property to nullptr before the TrackViewState method is called on an item, it is removed from the StateBag object. Otherwise, when you set this property to nullptr the key is saved to allow tracking of the item's view state.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.