System.Web.UI.HtmlControls Namespace HtmlInputControl Class
Sets or retrieves the type of an HtmlInputControl.
Inline |
<input type = strType ... > |
Script |
[ string var = ] HtmlInputControl.Type |
This property can only be set when declaring the control.
strType |
String that specifies the type of an HtmlInputControl. |
The following table shows the possible values for the type property.
Value |
Description |
text |
A text box for data entry |
password |
A text box that masks user input |
checkbox |
A check box that indicates a true or false condition |
radio |
A radio button that indicates a selection from a mutually
exclusive group of radio buttons |
button |
A command button |
submit |
A button that submits the form to the server |
reset |
A button that clears the form |
file |
A button that uploads a file |
hidden |
A non-visible field on a Web page used to persist information
between posts to the server |
image |
An image button |
The property is read-only after having been set when declaring the control. If not specified, Type defaults to text.
HTML input controls take different forms, the type of which is specified using the <input type=...> attribute at design time. If no type attribute is specified, the control defaults to a single-line textbox.
You can use this property to determine the type of an HtmlInputControl at run time.
For examples illustrating use of the various types of this control, see the HtmlInputText, HtmlInputButton, HtmlInputRadioButton, HtmlInputCheckBox, HtmlInputImage, HtmlInputHidden, and HtmlInputFile classes.
HtmlInputControl Members