Home   |   QuickStart Welcome   |   ASP.NET   |   Web Services   |   How Do I...?   
  |   I want my samples in...      

ASP.NET 2.0 Quickstart Tutorials

ImageButton

Like the Button control, ImageButton is used to post back to the server. For additional button examples, see Button and LinkButton.

The following sample illustrates using the ImageButton control.

VB ImageButton1.aspx
Run Sample View Source

Using ImageButton as an Image Map

The ImageButton click event also supplies the x/y coordinates of where the user clicked the image. This provides a means to respond differently depending on what part of the image is clicked.

The following sample illustrates using the ImageButton control as an image map.

VB ImageButton2.aspx
Run Sample View Source

Mouse-Over Effects on ImageButton

You can hook the client script events onmouseover and onmouseout on an ImageButton control to provide mouse-over effects such as changing the image source of the button. Client attributes such as onmouseover are disregarded by ASP.NET on the server and passed unchanged to the browser. If your application targets newer browsers that support DHTML, these events will occur in the browser as the cursor passes over the button.
VB ImageButton3.aspx
Run Sample View Source