Export (0) Print
Expand All

HttpResponse.ContentEncoding Property

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

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

public Encoding ContentEncoding { get; set; }
/** @property */
public Encoding get_ContentEncoding ()

/** @property */
public void set_ContentEncoding (Encoding value)

public function get ContentEncoding () : Encoding

public function set ContentEncoding (value : Encoding)

Not applicable.

Property Value

A Encoding object containing information about the character set of the current response.

Exception typeCondition

ArgumentNullException

Attempted to set ContentEncoding to a null reference (Nothing in Visual Basic).

Default ContentEncoding can be specified in an ASP.NET configuration file in the globalization Element (ASP.NET Settings Schema) section. If ContentEncoding is specified by the client, the default configuration settings are overridden.

The following example writes a human-readable description of the character set encoding to the output stream.

Response.Write (Response.ContentEncoding.EncodingName);
    

get_Response().Write(get_Response().get_ContentEncoding().
    get_EncodingName());

Response.Write(Response.ContentEncoding.EncodingName)
    

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft