ASP.NET HtmlInputHiddenControl
HTML Server Controls
Definition and Usage
The HtmlInputHidden control is used to control the <input type="hidden"> element. In HTML, this element is used to create a hidden input field.
Properties and Events
| Property | Description |
|---|---|
| Attributes | Returns all attribute name and value pairs for the element. |
| Disabled | A Boolean value indicating whether the control is disabled. Default is false. |
| id | The unique id of the element. |
| Name | The name of the element. |
| runat | Specifies that the control is a server control. Must be set to "server". |
| Style | Sets or returns the CSS properties applied to the control. |
| TagName | Returns the tag name of the element. |
| Type | The type of the element. |
| Value | The value of the hidden field. |
| Visible | A Boolean value indicating whether the control is visible. |
| Events | Description |
|---|---|
| ServerChange | This event occurs when the content of the element is changed. |
Examples
HTMLInputHidden
In this example, we declare an HtmlInputHidden control, an HtmlInputText control, an HtmlInputButton control, and an HtmlGeneric control in a .aspx file (remember to nest the controls inside an HtmlForm control). When the submit button is triggered, the submit subroutine is executed. This submit subroutine sets the value of the hidden field to the value of the input field and displays the value of the hidden field in a p element.
HTML Server Controls Other Extensions