The HtmlInputImage class defines the methods, properties and events for the HtmlInputImage control. This class allows programmatic access to the HTML <input type= image> element on the server.
Object
Control
HtmlControl
HtmlInputControl
HtmlInputImage
[Visual Basic] Public Class HtmlInputImage Inherits HtmlInputControl Implements IPostBackDataHandler, IPostBackEventHandler [C#] public class HtmlInputImage : HtmlInputControl, IPostBackDataHandler, IPostBackEventHandler [C++] public __gc class HtmlInputImage : public HtmlInputControl, IPostBackDataHandler, IPostBackEventHandler [JScript] public class HtmlInputImage extends HtmlInputControl, IPostBackDataHandler, IPostBackEventHandler
Web developers can use the HtmlImputImage control to create customized UI buttons with actions can be handled on the server.
Note Unlike <button> elements, all browsers support the HTML <input type=image> element.
Namespace: System.Web.UI.HtmlControls
Assembly: System.Web.dll
[Visual Basic]
<html> <script language="VB" runat=server> Sub SubmitBtn_Click(ByVal Source As Object, ByVal E as ImageClickEventArgs) Message.InnerHtml = "The Submit Button was clicked!" End Sub Sub ClearBtn_Click(ByVal Source As Object, ByVal E as ImageClickEventArgs) Message.InnerHtml = "The Clear Button was clicked!" End Sub </script> <body> <form method=post runat=server> <input type=image src="submit.gif" OnServerClick="SubmitBtn_Click" runat=server> <input type=image src="clear.gif" OnServerClick="ClearBtn_Click" runat=server> <h1> <span id="Message" runat=server></span> </h1> </body> </html>
HtmlInputImage Members | System.Web.UI.HtmlControls Namespace