ASP.NET Tutoria...login
ASP.NET Tutorial
author:php.cn  update time:2022-04-11 14:18:18

ImageButton control


ASP.NET ImageButton Control


up.gif Web server control

Definition and usage

ImageButton control to display clickable images.


Properties

##1.0ValidationGroupWhen the ImageButton posts back to the server, the ImageButton control causes validation against the control group. 2.0
PropertiesDescription.NET
CausesValidationSpecifies whether to validate the page when the ImageButton control is clicked. 1.0
CommandArgumentAdditional information about the command to execute. 1.0
CommandNameThe command related to the Command event. 1.0
GenerateEmptyAlternateTextSpecifies whether the control creates an empty string as alternative text. 2.0
OnClientClickThe name of the function to be executed when the image is clicked. 2.0
PostBackUrlWhen 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

Note: The properties of the Image control can also be used on the ImageButton control.

Web control standard properties

AccessKey, 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 properties

AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID, Visible
For a complete description, visit Control Standard Properties.


Example

ImageButton

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 Controlup.gif