Raises the ImageButton.Click event and allows you to handle the ImageButton.Click event directly.
- e
- A System.Web.UI.ImageClickEventArgs that contains the event data.
The ImageButton.Click event is raised when the System.Web.UI.WebControls.ImageButton control is clicked. By using the ImageButton.OnClick(System.Web.UI.ImageClickEventArgs) event handler, you can programmatically determine the coordinates where the image is clicked. You can then code a response, based on the values of these coordinates. Note that the origin (0, 0) is located at the upper left corner of the image.
Raising an event invokes the event handler through a delegate. For more information, see How to: Consume Events in a Web Forms Application.
The ImageButton.OnClick(System.Web.UI.ImageClickEventArgs) method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.