Export (0) Print
Expand All

HttpCachePolicy.SetCacheability Method (HttpCacheability)

Sets the Cache-Control header to one of the values of HttpCacheability.

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

public void SetCacheability (
	HttpCacheability cacheability
)
public void SetCacheability (
	HttpCacheability cacheability
)
public function SetCacheability (
	cacheability : HttpCacheability
)

Parameters

cacheability

An HttpCacheability enumeration value.

Exception typeCondition

ArgumentOutOfRangeException

cacheability is not one of the enumeration values.

The following code example demonstrates how to set the Cache-Control header to the enumerated value for no-cache.

Response.Cache.SetCacheability(HttpCacheability.NoCache);
 

get_Response().get_Cache().SetCacheability(HttpCacheability.NoCache);

Response.Cache.SetCacheability(HttpCacheability.NoCache)
 

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2015 Microsoft