This documentation is archived and is not being maintained.

Cache.Get Method

Retrieves the specified item from the Cache object.

[Visual Basic]
Public Function Get( _
   ByVal key As String _
) As Object
[C#]
public object Get(
 string key
);
[C++]
public: Object* Get(
 String* key
);
[JScript]
public function Get(
   key : String
) : Object;

Parameters

key
The identifier for the cache item to retrieve.

Return Value

The retrieved cache item, or a null reference (Nothing in Visual Basic) if the key is not found.

Example

[Visual Basic, C#, C++] The following example demonstrates how to retrieve the value cached for an ASP.NET text box server control.

[Visual Basic] 
Cache.Get("MyTextBox.Value")

[C#] 
Cache.Get("MyTextBox.Value");
   

[C++] 
Cache->Get(S"MyTextBox.Value");
   

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

Cache Class | Cache Members | System.Web.Caching Namespace | Caching Application Data

Show: