System.Web.UI.HtmlControls.HtmlButton Class

Allows programmatic access to the HTML <button> tag on the server.

See Also: HtmlButton Members

Syntax

[System.Web.UI.SupportsEventValidation]
[System.ComponentModel.DefaultEvent("ServerClick")]
public class HtmlButton : HtmlContainerControl, System.Web.UI.IPostBackEventHandler

Remarks

The <button> element allows Web developers to create user interface (UI) form buttons that can be composed of embedded HTML elements, including other server controls.

Note:

The <button> element is defined in the HTML 4.0 specification and is supported only in Microsoft Internet Explorer version 4.0 and later. To create UI form buttons for use in other browsers, consider using the System.Web.UI.HtmlControls.HtmlInputImage class.

To perform a set of custom instructions when the System.Web.UI.HtmlControls.HtmlButton control is clicked, provide a custom event handler for the HtmlButton.ServerClick event.

Note:

The System.Web.UI.HtmlControls.HtmlButton control renders ECMAScript to the client browser. The client browser must have ECMAScript enabled for this control to function properly. For more information on client script, see Client Script in ASP.NET Web Pages.

For a list of initial property values for an instance of System.Web.UI.HtmlControls.HtmlButton, see the HtmlButton.#ctor constructor.

Note:

This control can be used to display user input, which might include malicious client script. Check any information that is sent from a client for executable script, SQL statements, or other code before displaying it in your application. ASP.NET provides an input request validation feature to block script and HTML in user input. Validation server controls are also provided to assess user input. For more information, see Validation Server Controls.

Requirements

Namespace: System.Web.UI.HtmlControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0