asp.net.ph

ImageButton.Command Event

System.Web.UI.WebControls Namespace   ImageButton Class


Occurs when an ImageButton control on a Web Forms page is clicked.

[ VB ]
Public Event Command As CommandEventHandler

[ C# ]
public event CommandEventHandler Command;

[ C++ ]
public: __event CommandEventHandler* Command;

In [ JScript ], you can handle the events defined by a class, but you cannot define your own.

Event Data

The method assigned to handle the event is passed a CommandEventArgs object containing data related to the Command event. The following CommandEventArgs properties provide information specific to this event.

Property Description
CommandArgument Gets the argument for the command. This property is read-only.
CommandName Gets the name of the command. This property is read-only.

Remarks

A Command event is raised whenever an ImageButton control on a Web Forms page is clicked. This event is raised along with the imagebutton's Click event, and is commonly used when multiple ImageButton controls with different command names are defined on a Web Forms page.

The page framework passes the command name and argument of the imagebutton that caused the event to the designated event handler. This provides a convenient way to programmatically determine which command to perform.

For more information about handling events, see Web Forms Events Model.

Example

The following example demonstrates how to specify and code a handler for the Command event of an ImageButton control.

ImageButton Command Event Example
Run Sample | View Source
See Also

ImageButton Members   Click Event Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph