This documentation is archived and is not being maintained.

Page.Cache Property

Gets the Cache object associated with the application in which the page resides.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

public:
property Cache^ Cache {
	Cache^ get ();
}
/** @property */
public Cache get_Cache ()

public function get Cache () : Cache

Not applicable.

Property Value

The Cache associated with the page's application.

Exception typeCondition

HttpException

An instance of Cache is not created.

An application's Cache object allows you to store and retrieve arbitrary data on subsequent requests. The cache is not specifically associated with a page or user session. It is used primarily to enhance application performance. For more information, see Caching Application Data. For more information on the difference between application caching and page output caching, see Introduction to Caching in ASP.NET.

The following code example inserts the sum of two integers into the System.Web.Caching.Cache object using the Page.Cache property. It then retrieves the value using the System.Web.Caching.Cache.Get(System.String) method and writes it to a Label Web server control.

No code example is currently available or this language may not be supported.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
Show: