ASP.NET ImageButtonControl


Web Server ControlsWeb Server Control

Definition and Usage

The ImageButton control is used to display a clickable image.


Attributes

Attribute Description .NET
CausesValidation Specifies whether the page is validated when the ImageButton control is clicked. 1.0
CommandArgument Additional information about the command to be executed. 1.0
CommandName The command associated with the Command event. 1.0
GenerateEmptyAlternateText Specifies whether the control creates an empty string as alternate text. 2.0
OnClientClick The name of the function to execute when the image is clicked. 2.0
PostBackUrl The URL of the target page to post back to from the current page when the ImageButton is clicked. 2.0
runat Specifies that the control is a server control. Must be set to "server". 1.0
TagKey 1.0
ValidationGroup The group of controls for which the ImageButton control causes validation when it posts back to the server. 2.0

Note: Image controlThe attributes of the Image control can also be used on the ImageButton control.

Web Control Standard Attributes

AccessKey, Attributes, BackColor, BorderColor, BorderStyle, BorderWidth, CssClass, Enabled, Font, EnableTheming, ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width

For a complete description, please visitWeb Control Standard Attributes。

Control Standard Attributes

AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID, Visible

For a complete description, please visitControl Standard Attributes。


Examples

ImageButton
In this example, we declare an ImageButton control and a Label control in a .aspx file. When the user clicks the image, a subroutine is executed. This subroutine sends the message "Coordinates: " along with the x and y coordinates of the click to the Label control.


Web Server ControlsWeb Server Control Other Extensions