System.Web.UI.HtmlControls Namespace HtmlForm Class
Sets or retrieves a value that specifies the encoding type attribute of the form.
Inline |
<form enctype = strEncType ... > |
Script |
HtmlForm.EncType [ = strEncType ] |
strEncType |
String specifying the format of the data being submitted by the form. |
The property is read/write with a default value of applicaton/x-www-form-urlencoded.
The following table lists the supported encoding types:
- applicaton/x-www-form-urlencoded
- multipart/form-data
- text/plain
- image/jpeg
Use this property to specify the MIME type encoding for the form when the Method is POST. MIME type defines the encoding format browsers should use when posting the form's data back to the server. The standard encoding format is the Internet Media Type applicaton/x-www-form-urlencoded.
When used in combination with the <input type=file> control, the value multipart/form-data is required to submit the file upload to the server.
The below code shows how to declaratively set the EncType property of an HtmlForm control at design time, to set up a form that uploads a file to the server.
<form enctype="multipart/form-data" runat="server">
Show me
HtmlForm Members Method