This documentation is archived and is not being maintained.

ButtonColumn.CommandName Property

Gets or sets a string that represents the command to perform when a button in the System.Web.UI.WebControls.ButtonColumn is clicked.

[Visual Basic]
Public Overridable Property CommandName As String
[C#]
public virtual string CommandName {get; set;}
[C++]
public: __property virtual String* get_CommandName();
public: __property virtual void set_CommandName(String*);
[JScript]
public function get CommandName() : String;
public function set CommandName(String);

Property Value

A string that represents the command to perform when a button in the ButtonColumn is clicked. The default value is String.Empty.

Remarks

Use the CommandName property to associate a command name, such as Add or Remove, with a button. You can set the CommandName property to any string that identifies the action to perform when the command button is clicked. You can then programmatically determine the command name in the event handler for the ItemCommand event and perform the appropriate actions.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

ButtonColumn Class | ButtonColumn Members | System.Web.UI.WebControls Namespace | ItemCommand | String.Empty

Show: