HtmlInputButton Server Control Declarative Syntax
Creates a server-side control that maps to the <input type=button>, <input type=submit>, and <input type=reset> HTML elements and allows you to create a command button, submit button, or reset button, respectively.
<input
Type="Button|Reset|Submit"
EnableViewState="False|True"
Id="string"
Visible="False|True"
OnDataBinding="OnDataBinding event handler"
OnDisposed="OnDisposed event handler"
OnInit="OnInit event handler"
OnLoad="OnLoad event handler"
OnPreRender="OnPreRender event handler"
OnServerClick="OnServerClick event handler"
OnUnload="OnUnload event handler"
runat="server"
/>
Use the HtmlInputButton control to program against the <input type=button>, <input type=submit>, and <input type=reset> HTML elements. When a user clicks an HtmlInputButton control, input from the form that the control is embedded on is posted to the server and processed. A response is then sent back to the requesting browser.
By providing a custom event handler for the ServerClick event, you can perform a specific set of instructions when the control is clicked.
Note |
|---|
A reset button does not support the ServerClick event. When a reset button is clicked, all input controls on the page are not necessarily cleared. Instead, they are returned to their original state when the page was loaded. For example, if a text box originally contained the value "JohnDoe", clicking on the reset button would return the text box to this value. |
When used in conjunction with the HtmlInputText and HtmlTextArea controls, you can create user input or authentication pages that can be processed on the server.
Note |
|---|
This control does not require a closing tag. |
The following example demonstrates how to use an HtmlInputButton control to submit a form to the server for processing.
Note