ASP.NET HtmlButtonControl


HTML Server ControlsHTML Server Controls

Definition and Usage

The HtmlButton control is used to control the <button> element. In HTML, the <button> element is used to create a push button.


Properties

Property Description
Attributes Returns all attribute names and value pairs of the element.
Disabled A boolean value indicating whether the control is disabled. The default is false.
id The unique id of the control.
InnerHtml Sets or returns the content between the start and end tags of the HTML element. Special characters are not automatically converted to HTML entities.
InnerText Sets or returns all text between the start and end tags of the HTML element. Special characters are automatically converted to HTML entities.
OnServerClick The name of the function executed when the button is clicked.
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.
Visible A boolean value indicating whether the control is visible.


Example

HTMLButton
In this example, we declare two HtmlButton controls in the .aspx file (remember to nest the controls inside the HtmlForm control). Next, we write an event handler (an event handler is a subroutine that executes code for a given event) to specify the action to be performed when the button is clicked.


HTML Server ControlsHTML Server Controls Other Extensions