ImageButton 控件用於顯示可點擊的圖像。
注釋:Image 控件的屬性也能夠用在 ImageButton 控件上。
AccessKey, Attributes, BackColor, BorderColor, BorderStyle, BorderWidth, CSSClass, Enabled, Font, EnableTheming, ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width
AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls, EnableTheming, EnableVIEwState, ID, NamingContainer, Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID, Visible
<ASP:ImageButton
Id="控件名稱"
Runat="Server"
Command="命令名稱"
CommandArgument="命令參數"
OnClick="事件程序名"
/>
<% Page Language=C#>
<Html>
<Form Id="Form1" Runat="Server">
<ASP:ImageButton Id="Button1" ImageUrl="abc.jpg" Onclick="Button1_Click" Runat="Server"/><p>
<ASP:Label Id="Label1" Runat="Server" />
</Form>
<Script Runat="Server">
void Button1_Click(Object Sender, ImageClickEventArgs e){
Label1.Text="你所要看的圖片是 " + e.X.ToString() + ", " + e.Y.ToString() + " 的位置按下鼠標";
}
</Script>
</Html>