?
このドキュメントでは、 php中國語ネットマニュアル リリース
ImageButton 控件用于顯示可點擊的圖像。
屬性 | 描述 | .NET |
---|---|---|
CausesValidation | 規(guī)定在 ImageButton 控件被點擊時,是否驗證頁面。 | 1.0 |
CommandArgument | 有關(guān)要執(zhí)行的命令的附加信息。 | 1.0 |
CommandName | 與 Command 事件相關(guān)的命令。 | 1.0 |
GenerateEmptyAlternateText | 規(guī)定該控件是否創(chuàng)建空字符串作為替代文本。 | 2.0 |
OnClientClick | 當圖像被點擊時要執(zhí)行的函數(shù)的名稱。 | 2.0 |
PostBackUrl | 當 ImageButton 被點擊時,從當前頁面進行回傳的目標頁面的 URL。 | 2.0 |
runat | 規(guī)定該控件是一個服務(wù)器控件。必須被設(shè)置為 "server"。 | 1.0 |
TagKey | 1.0 | |
ValidationGroup | 當 ImageButton 回傳服務(wù)器時,該 ImageButton 控件引起驗證所針對的控件組。 | 2.0 |
注釋: Image 控件的屬性也能夠用在 ImageButton 控件上。
AccessKey,?Attributes,?BackColor,?BorderColor,?BorderStyle,?BorderWidth,?CssClass,?Enabled,?Font,?EnableTheming,?ForeColor,?Height,?IsEnabled,?SkinID,?Style,?TabIndex,?ToolTip,?Width
如需完整描述,請訪問 Web 控件標準屬性。
AppRelativeTemplateSourceDirectory,?BindingContainer,?ClientID,?Controls,?EnableTheming,?EnableViewState,?ID,?NamingContainer,?Page,?Parent,?Site,?TemplateControl,?TemplateSourceDirectory,?UniqueID,?Visible
如需完整描述,請訪問 控件標準屬性。
ImageButton
<script??runat="server"> Sub?getCoordinates(sender?As?Object,?e?As?ImageClickEventArgs)? ???mess.Text="Coordinates:?"?&?e.x?&?",?"?&?e.y End?Sub </script> <!DOCTYPE?html> <html> <body> <form?runat="server"> <p>Click?on?the?image:</p> <asp:ImageButton runat="server" ImageUrl="smiley.gif" OnClick="getCoordinates"/> <p><asp:label?id="mess"?runat="server"/></p> </form> </body> </html>
在本例中,我們在 .aspx 文件中聲明了一個 ImageButton 控件和一個 Label 控件。在用戶點擊此圖像時,會執(zhí)行 subroutine 子例程。這個子例程會把消息 "Coordinates: " 以及單擊的 x 和 y 坐標發(fā)送到 Label 控件。