ImageButton control
ASP.NET ImageButton Control
Web server control
Definition and usage
ImageButton control to display clickable images.
Properties
Properties | Description | .NET |
---|---|---|
CausesValidation | Specifies whether to validate the page when the ImageButton control is clicked. | 1.0 |
CommandArgument | Additional information about the command to execute. | 1.0 |
CommandName | The command related to the Command event. | 1.0 |
GenerateEmptyAlternateText | Specifies whether the control creates an empty string as alternative text. | 2.0 |
OnClientClick | The name of the function to be executed when the image is clicked. | 2.0 |
PostBackUrl | When the ImageButton is clicked, the URL of the target page to post back from the current page. | 2.0 |
runat | Specifies that the control is a server control. Must be set to "server". | 1.0 |
TagKey | ||
When the ImageButton posts back to the server, the ImageButton control causes validation against the control group. | 2.0 |
Note: The properties of the Image control can also be used on the ImageButton control.
Web control standard propertiesAccessKey, Attributes, BackColor, BorderColor,
BorderStyle, BorderWidth, CssClass, Enabled, Font, EnableTheming,
ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width
For a complete description, visit Web Control Standard Properties. Control standard propertiesAppRelativeTemplateSourceDirectory, BindingContainer,
ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer,
Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID,
Visible
For a complete description, visit Control Standard Properties. ExampleImageButton
In this example, we declare an ImageButton control and a Label control in the .aspx file. When the user clicks on this image, the subroutine subroutine is executed. This subroutine sends the message "Coordinates: " and the x and y coordinates of the click to the Label control.
Web Server Control