Latest web development tutorials

ASP.NET HtmlInputImage Controls

HTML Server Controls HTML server controls

Definition and Usage

HtmlInputImage control is used to control the <input type = "image"> elements. In HTML, this element is used to create images using the button instead of the conventional button.


Attributes

属性 描述
Align 图像的对齐方式。
Alt 供显示的图像替代文本。
Attributes 返回该元素的所有属性名称和值对。
Border 元素周围的边框的宽度。
Disabled 布尔值,指示是否禁用该控件。默认是 false。
id 控件的唯一 id。
Name 元素的名称。
OnServerClick 当图像被点击时被执行的函数的名称。
runat 规定该控件是一个服务器控件。必须被设置为 "server"。
Src 图像的源。
Style 设置或返回被应用到该控件的 CSS 属性。
TagName 返回元素的标签名。
Type 元素的类型。
Value 元素的值。
Visible 布尔值,指示该控件是否可见。


Examples

HTMLInputImage
In this example, we declare two HtmlInputImage HtmlGeneric controls and a control in an .aspx file (remember to control nested HtmlForm control). If the user clicks the first image is performed button1 subroutine. This subroutine sends the message to the p element "You clicked the smiley button!". If the user clicks the second image is performed, button2 subroutine. This subroutine sends the message to the p element "You clicked the angry button!".


HTML Server Controls HTML server controls