Provides data for any events that occur when a user clicks an image-based ASP.NET server control, such as the HtmlInputImage or ImageButton server controls. This class cannot be inherited.
Namespace: System.Web.UI Assembly: System.Web (in system.web.dll)
This class passes the location where a user clicked an HtmlInputImage server control or an ImageButton Web server control. Clicking an HtmlInputImage server control causes a ServerClick event to occur, while clicking an ImageButton server control causes a Click event to occur. You can then use event handlers to programmatically respond to the event based on the value of these coordinates.
The origin coordinates (0,0) are located at the upper left corner of the image.
Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.
// Define the event handler that uses coordinate information through ImageClickEventArgs.void ImageButton_Click(object sender, ImageClickEventArgs e)
Label1.Text = "You clicked the ImageButton control at the coordinates: (" +
e.X.ToString() + ", " + e.Y.ToString() + ")";