Cache::Item Property
Gets or sets the cache item at the specified key.
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
A String object that represents the key for the cache item.
You can use this property to retrieve the value of a specified cache item, or to add an item and a key for it to the cache. Adding a cache item using the Item property is equivalent to calling the Cache::Insert method.
The following example uses the Item property to retrieve the value of a cached object associated with the Key1 key. It then uses the HttpResponse::Write method to write the value and introductory text and the B HTML element to a Web Forms page.
The following example demonstrates using this property to insert the value of a text box into the cache.
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.