Controls You Can Use on Web Forms ASP.NET Standard Controls Button Controls
An ImageButton control allows you to present a graphic as a clickable control.
- Declare an <
asp:ImageButton > element on the page.
- Set the button’s ImageUrl property to point to an image file ( .gif, .jpg, .png ).
- Assign the handler that will receive control when the Click event of the button occurs ( i.e., when a user clicks the control ).
<asp:ImageButton runat="server"
ImageUrl="myPic.jpg"
onClick="doSomething" />
The following sample illustrates using the ImageButton control.
The ImageUrl property can also be bound to a data source to display graphics based on database information, as when an ImageButton control is used within templated controls such as a DataGrid, DataList, GridView, FormView or Repeater.
The below example demonstrates how to assign a value to the ImageUrl property based on database information.
Determining Coordinates In an ImageButton Control ImageButton Control Syntax
|