Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
HttpResponse Class
 HeaderEncoding Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
HttpResponse..::.HeaderEncoding Property

Gets or sets an Encoding object that represents the encoding for the current header output stream.

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)
Visual Basic (Declaration)
Public Property HeaderEncoding As Encoding
Visual Basic (Usage)
Dim instance As HttpResponse
Dim value As Encoding

value = instance.HeaderEncoding

instance.HeaderEncoding = value
C#
public Encoding HeaderEncoding { get; set; }
Visual C++
public:
property Encoding^ HeaderEncoding {
    Encoding^ get ();
    void set (Encoding^ value);
}
JScript
public function get HeaderEncoding () : Encoding
public function set HeaderEncoding (value : Encoding)

Property Value

Type: System.Text..::.Encoding
An Encoding that contains information about the character set for the current header.
ExceptionCondition
ArgumentNullException

The encoding value is nullNothingnullptra null reference (Nothing in Visual Basic).

HttpException

The encoding value is Unicode.

- or -

The headers have already been sent.

The HeaderEncoding property gives you the ability to disable or change the Encoding object on a response header by using the ASCIIEncoding, UnicodeEncoding, UTF7Encoding, or UTF8Encoding object. The default encoding value is the UTF8Encoding class.

By changing the type of the HeaderEncoding property, you can potentially increase the risk of certain malicious attacks or cause sensitive data to be sent through the response header. Header injection attacks can be avoided, in part, by leaving the HeaderEncoding property of a response to the default setting. An attack against a vulnerable application could echo back entrusted data as part of a response header. If the HeaderEncoding is disabled because of a requirement for continuation lines in a header or if any header is constructed based on the result of untrusted data, the header data should be validated before sending to the response stream.

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
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker