This documentation is archived and is not being maintained.

HtmlForm::Enctype Property

Gets or sets the encoding type a browser uses when posting the form's data to the server.

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

public:
property String^ Enctype {
	String^ get ();
	void set (String^ value);
}
<asp:HtmlForm Enctype="String" />

Property Value

Type: System::String
A string that contains the encoding type. The default value is an empty string (""), indicating that the browser's default content type is used.

Use the Enctype property to specify the encoding type a browser uses to post data back to the server.

The following table shows the common encoding types.

Encoding type

Description

application/x-www-form-urlencoded

Form data is encoded as name/value pairs. This is the standard encoding format.

multipart/form-data

Form data is encoded as a message with a separate part for each control on the page.

text/plain

Form data is encoded in plain text, without any control or formatting characters.

For more information on encoding types, see the World Wide Web Consortium (W3C Web site.

The following code example demonstrates how to use the Enctype property to specify the encoding type the browser uses to send data back to the server.

No code example is currently available or this language may not be supported.

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, 1.1, 1.0
Show: