Button Controls
Button controls are controls that post the form back to the server, enabling server-side processing to commence. There are three types of ASP.NET button controls, all members of the System.Web.UI.WebControls namespace:
ButtonThis is the standard button.
LinkButtonThe
LinkButtoncontrol is a cross between a standard button and aHyperLinkcontrol (described in the next section). ALinkButtonappears to the user as a hyperlink (i.e., the text is colored and underlined), but it performs the standard postback behavior.ImageButtonThe
ImageButtoncontrol performs the same function as the standard button, except that an image bitmap takes the place of the button on the browser UI. For theImageButtoncontrol, there is noTextattribute but there is anAlternateTextattribute, which specifies what text to display on nongraphical browsers instead of the image.The event handler uses an
ImageClickEventArgsevent argument rather than theEventArgsargument used in the event handlers for theButtonandLinkButtoncontrols. This event argument exposes two fields containing the x and y coordinates of the location where the user clicked on the image.
In addition to all the properties, methods, and events inherited from WebControl, all three button types have the following two events:
ClickThis event is raised when the control is clicked and no command name is associated with the
Button(i.e., no value has been assigned to theButtoncontrol’sCommandNameproperty). The method is passed ...