Charset Property

HttpResponse.Charset Property

 

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:
© 2016 Microsoft