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
)
Not applicable.

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 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

Community Additions

ADD
Show:
© 2015 Microsoft