HttpCacheVaryByHeaders.Item Property
Gets or sets a custom header field that the origin server adds to the Vary HTTP header.
[C#] In C#, this property is the indexer for the HttpCacheVaryByHeaders class.
[Visual Basic] Public Default Property Item( _ ByVal header As String _ ) As Boolean [C#] public bool this[ string header ] {get; set;} [C++] public: __property bool get_Item( String* header ); public: __property void set_Item( String* header, bool ); [JScript] returnValue = HttpCacheVaryByHeadersObject.Item(header); HttpCacheVaryByHeadersObject.Item(header) = returnValue; -or- returnValue = HttpCacheVaryByHeadersObject(header); HttpCacheVaryByHeadersObject(header) = returnValue;
[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.
Arguments [JScript]
- header
- The name of the custom header.
Parameters [Visual Basic, C#, C++]
- header
- The name of the custom header.
Property Value
The default value is false. When set to true, this property causes ASP.NET to add the specified custom field to the Vary HTTP header sent to the client.
Exceptions
| Exception Type | Condition |
|---|---|
| ArgumentNullException | header is a null reference (Nothing in Visual Basic). |
Remarks
The Vary header indicates the request-header fields that the server uses to determine which of multiple cached responses is sent in response to a client request.
For more information on HTTP cache control headers, see RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1, available on the World Wide Web Consortium's Web site at http://www.w3c.org. See section 14, "Header Field Definitions", for complete details.
Requirements
Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family
See Also
HttpCacheVaryByHeaders Class | HttpCacheVaryByHeaders Members | System.Web Namespace