System.Web.UI.WebControls Namespace
Renders a push button control on a Web Forms page.
Visibility |
Constructor |
Parameters |
public |
Button |
( )
|
|
Use the Button control to create either a submit or a command push button control that posts the page back to the server.
By default, a Button control is a submit button, which simply posts the Web page back to the server. To programmatically control the action performed when the submit button is clicked, you define an event handler for the button's Click event.
A command button, on the other hand, is a Button control that can be used to invoke commands. This is basically done by associating the button with a CommandName ( ex. select, sort, edit, update, delete, etc. ). This allows you to create multiple Button controls on a Web page and programmatically determine which button is clicked.
An optional CommandArgument property can be used with a command button to provide additional information about the command to perform ( ex. ascending ). Likewise, to programmatically control the actions performed when the command button is clicked, you define an event handler for the button's Command event.
For examples illustrating use of this control, see the individual member types of this class. For syntax information, see Button in ASP.NET Syntax for Web Controls.
LinkButton ImageButton