ASP.NET ImageButton control
Definition and Usage
ImageButton control clickable image for display.
Attributes
属性 | 描述 | .NET |
---|---|---|
CausesValidation | 规定在 ImageButton 控件被点击时,是否验证页面。 | 1.0 |
CommandArgument | 有关要执行的命令的附加信息。 | 1.0 |
CommandName | 与 Command 事件相关的命令。 | 1.0 |
GenerateEmptyAlternateText | 规定该控件是否创建空字符串作为替代文本。 | 2.0 |
OnClientClick | 当图像被点击时要执行的函数的名称。 | 2.0 |
PostBackUrl | 当 ImageButton 被点击时,从当前页面进行回传的目标页面的 URL。 | 2.0 |
runat | 规定该控件是一个服务器控件。必须被设置为 "server"。 | 1.0 |
TagKey | 1.0 | |
ValidationGroup | 当 ImageButton 回传服务器时,该 ImageButton 控件引起验证所针对的控件组。 | 2.0 |
NOTE: Image control properties can also be used in 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 full description, visit the Web Control Standard Attributes .
Control Standard Properties
AppRelativeTemplateSourceDirectory, BindingContainer,
ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer,
Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID,
Visible
For a full description, go to Control Standard Attributes .
Examples
ImageButton
In this example, we declare an ImageButton control and a Label control in an .aspx file. The user clicks on the image, it will execute subroutine subroutine. This subroutine will message "Coordinates:" as well as the x and y coordinates of the click is sent to the Label control.
Web server control