Easy Tutorial
❮ Webpages Ref Helpers Prop Webcontrol Style Forecolor ❯

ASP.NET Button Control



Definition and Usage

The Button control is used to display a push button. The push button can be a submit button or a command button. By default, this control is a submit button.

A submit button does not have a command name and sends the page back to the server when clicked. You can write an event handler to control the action performed when the submit button is clicked.

A command button has a command name and allows you to create multiple button controls on a page. You can write an event handler to control the action performed when the command button is clicked.


Properties

Property Description .NET
CausesValidation Specifies whether the page is validated when the Button is clicked. 1.0
CommandArgument Provides additional information about the command to be executed. 1.0
CommandName Specifies the command associated with the Command event. 1.0
OnClientClick Specifies the name of the function to be executed when the button is clicked. 2.0
PostBackUrl Specifies the URL of the target page to which data is transferred from the current page when the Button control is clicked. 2.0
runat Specifies that the control is a server control. Must be set to "server". 1.0
Text Specifies the text on the button. 1.0
UseSubmitBehavior A value that specifies whether the button uses the browser's submit mechanism or the ASP.NET postback mechanism. 2.0
ValidationGroup Specifies the control group for which the button causes validation when it posts back to the server. 2.0

Web Control Standard Properties

For a complete description, visit Web Control Standard Properties.

Control Standard Properties

For a complete description, visit Control Standard Properties.


Try it Yourself - Examples

Button

Button 2


❮ Webpages Ref Helpers Prop Webcontrol Style Forecolor ❯