Get the cache item stored in cache.
Namespace: Alachisoft.NCache.Web.CachingAssembly: Alachisoft.NCache.Web (in Alachisoft.NCache.Web.dll) Version: 4.1.0.0 (4.1.0.0)
Syntax
C# |
---|
public virtual CacheItem GetCacheItem( string key ) |
Visual Basic |
---|
Public Overridable Function GetCacheItem ( _ key As String _ ) As CacheItem |
Visual C++ |
---|
public: virtual CacheItem^ GetCacheItem( String^ key ) |
Parameters
- key
- Type: System..::..String
Key used to reference the desired object
Return Value
CacheItemRemarks
Note: If exceptions are enabled through the ExceptionsEnabled setting, this property throws exception incase of failure.
Examples
The following example demonstrates how to retrieve the value cached for an ASP.NET text
box server control.
CopyC#
Cache cache = NCache.InitializeCache("myCache");
CacheItem item = cache.GetCacheItem(key);