.NET Framework Class Library
HttpResponse.CacheControl Property

Sets the Cache-Control HTTP header to Public or Private.

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

Syntax

Visual Basic (Declaration)
Public Property CacheControl As String
Visual Basic (Usage)
Dim instance As HttpResponse
Dim value As String

value = instance.CacheControl

instance.CacheControl = value
C#
public string CacheControl { get; set; }
C++
public:
property String^ CacheControl {
    String^ get ();
    void set (String^ value);
}
J#
/** @property */
public String get_CacheControl ()

/** @property */
public void set_CacheControl (String value)
JScript
public function get CacheControl () : String

public function set CacheControl (value : String)

Property Value

"Public" or "Private".
Exceptions

Exception typeCondition

ArgumentException

CacheControl is an invalid cache control value (not Private or Public).

Remarks

The values for Private and Public are strings and must be enclosed in quotation marks (" ").

The CacheControl, Expires, and ExpiresAbsolute properties have been deprecated in favor of the methods of the HttpCachePolicy class available through the Cache intrinsic object to control the IIS output cache and client caches.

Platforms

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.

Version Information

.NET Framework

Supported in: 2.0, 1.1, 1.0
See Also

Tags :


Page view tracker