System.Web.UI.WebControls Namespace ImageButton Class
Occurs when an ImageButton control on a Web Forms page is clicked.
[ VB ]
Public Event Click As ImageClickEventHandler
[ C# ]
public event ImageClickEventHandler Click;
[ C++ ]
public: __event ImageClickEventHandler* Click;
In [ JScript ], you can handle the events defined by a class, but you cannot define your own.
The method assigned to handle the event is passed an ImageClickEventArgs object containing data related to the Click event.
A Click event is raised whenever an ImageButton control on a Web Forms page is clicked. This event is commonly used when no command name is associated with the ImageButton control, typically to trigger a form submit handler.
Unlike the Button.Click and LinkButton.Click events, though, the coordinates where the image is clicked is accessible in the event arguments passed to the designated handler. You can then code a response based on the values of these coordinates. Note the origin ( 0, 0 ) is located at the upper left corner of the image.
For more information about handling events, see Web Forms Events Model.
The following example demonstrates how to specify and code a handler for the Click event of an ImageButton control.
ImageButton Members Command Event