Raises the DataList.ItemCommand event. This allows you to provide a custom handler for the event.
- e
- A System.Web.UI.WebControls.DataListCommandEventArgs that contains event data.
Use the DataList.OnItemCommand(DataListCommandEventArgs) method to provide a custom handler for the DataList.ItemCommand event.
The DataList.ItemCommand event is raised when any button is clicked in the System.Web.UI.WebControls.DataList control and is commonly used when you have a button control with a custom CommandName value, such as Add, in the System.Web.UI.WebControls.DataList control.
Raising an event invokes the event handler through a delegate. For more information, see How to: Consume Events in a Web Forms Application.
The DataList.OnItemCommand(DataListCommandEventArgs) 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.