asp.net.ph

HtmlForm.Enctype Property

System.Web.UI.HtmlControls Namespace   HtmlForm Class


Sets or retrieves a value that specifies the encoding type attribute of the form.

Syntax


Inline <form enctype = strEncType ... >
Script HtmlForm.EncType [ = strEncType ]

Property Value


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

Remarks

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.

Example

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 

See Also

HtmlForm Members   Method Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph