asp.net.ph

Button Class

System.Web.UI.WebControls Namespace


Renders a push button control on a Web Forms page.

Button Class Members

Collapse   Constructors

Visibility Constructor Parameters
public Button ( )

Collapse   Properties

Visibility Name Value Type Accessibility
public CausesValidation Boolean [ Get , Set ]
public CommandArgument String [ Get , Set ]
public CommandName String [ Get , Set ]
public OnClientClick String [ Get , Set ]
public PostBackUrl String [ Get , Set ]
public Text String [ Get , Set ]
public UseSubmitBehavior Boolean [ Get , Set ]
public ValidationGroup String [ Get , Set ]

Collapse   Methods

Visibility Name Parameters Return Type
protected AddAttributesToRender ( HtmlTextWriter writer ) Void
protected GetPostBackOptions ( ) PostBackOptions
protected OnClick ( EventArgs e ) Void
protected OnCommand ( CommandEventArgs e ) Void
protected RaisePostBackEvent ( String eventArgument ) Void

Collapse   Events

Multicast Name Type
multicast Click EventHandler
multicast Command CommandEventHandler

Remarks

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.

See Also

LinkButton   ImageButton Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph