This documentation is archived and is not being maintained.

HttpCacheVaryByHeaders.UserLanguage Property

Gets or sets a value indicating whether the origin server adds the Accept-Language field to the Vary HTTP header.

[Visual Basic]
Public Property UserLanguage As Boolean
[C#]
public bool UserLanguage {get; set;}
[C++]
public: __property bool get_UserLanguage();
public: __property void set_UserLanguage(bool);
[JScript]
public function get UserLanguage() : Boolean;
public function set UserLanguage(Boolean);

Property Value

The default value is false. When set to true, this property causes ASP.NET to add the Accept-Language field to the Vary HTTP header sent to the client.

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. The Accept-Language field specifies that the server selects the response based on languages acceptable to the client.

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.

Example

This example performs some action only if the UserLanguage property is True.

 [Visual Basic]
 <%
 'This example performs some action only if the UserLanguage
 property
 'is True.
 If Response.Cache.VaryByHeaders.UserLanguage = True Then
    ...
 End If
 %>
    

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpCacheVaryByHeaders Class | HttpCacheVaryByHeaders Members | System.Web Namespace

Show: