HttpResponse.Charset Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the HTTP character set of the output stream.

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

public string Charset { get; set; }

Property Value

Type: System.String

The HTTP character set of the output stream.

Exception Condition
HttpException

The Charset property was set after headers were sent.

The Charset property can be set to null to suppress the HTTP Content-Type header.

The following example checks whether the character set of the output stream is Central European (ISO).

if (Response.Charset == "iso-8859-2")
{
    // ...
}

.NET Framework
Available since 1.1
Return to top
Show: