HttpResponse.Charset Property

Definition

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

C#
public string Charset { get; set; }

Property Value

The HTTP character set of the output stream.

Exceptions

The Charset property was set after headers were sent.

Examples

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

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

Remarks

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

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1