OnItemCommand Method (Command)

Called when the user activates the control.

protected virtual void OnItemCommand(
   System.Web.UI.WebControls.CommandEventArgs e
)

Parameters

  • e
    An object (defined by CommandEventArgs) that contains event data.

Remarks

The default implementation raises the ItemCommand event. Inheriting classes can override this method to perform other tasks.

The OnItemCommand event is raised after the Onclick event. This is useful when you must take the same actions for multiple Command buttons. You can use the CommandName or CommandArgument property of the Command control to identify which Command button was clicked.

See Also

Applies to: Command Class