This documentation is archived and is not being maintained.

HttpCacheVaryByParams::Item Property

Gets or sets a value indicating whether the cache varies according to the specified HTTP request parameter.

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

public:
property bool Item[String^ header] {
	bool get (String^ header);
	void set (String^ header, bool value);
}

Parameters

header
Type: System::String

The name of the custom parameter.

Property Value

Type: System::Boolean
true if the cache should vary by the specified parameter value.

ExceptionCondition
ArgumentNullException

header is nullptr.

When used as an accessor (getter), the Item indexer returns true if a value for the specified parameter is found in the current parameters collection, or if the collection is set to vary by * (an asterisk), which indicates all parameters.

When used as a mutator (setter), the Item indexer sets the value for the parameter in the parameters collection that corresponds to the specified header to true. The value * can be specified, which indicates all parameters.

The following code example demonstrates how the Item indexer is accessed from the HttpCachePolicy object associated with an HttpResponse.

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

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