CommandEventArgs CommandEventArgs CommandEventArgs CommandEventArgs Constructors

Definition

Overloads

CommandEventArgs(CommandEventArgs) CommandEventArgs(CommandEventArgs) CommandEventArgs(CommandEventArgs) CommandEventArgs(CommandEventArgs)

Initializes a new instance of the CommandEventArgs class with another CommandEventArgs object.

CommandEventArgs(String, Object) CommandEventArgs(String, Object) CommandEventArgs(String, Object) CommandEventArgs(String, Object)

Initializes a new instance of the CommandEventArgs class with the specified command name and argument.

CommandEventArgs(CommandEventArgs) CommandEventArgs(CommandEventArgs) CommandEventArgs(CommandEventArgs) CommandEventArgs(CommandEventArgs)

Initializes a new instance of the CommandEventArgs class with another CommandEventArgs object.

public:
 CommandEventArgs(System::Web::UI::WebControls::CommandEventArgs ^ e);
public CommandEventArgs (System.Web.UI.WebControls.CommandEventArgs e);
new System.Web.UI.WebControls.CommandEventArgs : System.Web.UI.WebControls.CommandEventArgs -> System.Web.UI.WebControls.CommandEventArgs
Public Sub New (e As CommandEventArgs)

Parameters

Examples

The following example demonstrates how to create and initialize a new instance of the CommandEventArgs class using the specified CommandEventArgs object.

void Command_Button_Click(Object sender, CommandEventArgs e) 
{
    CommandEventArgs args = new CommandEventArgs(e);    
}
   
Private Sub Command_Button_Click(sender As Object, e As CommandEventArgs)
    Dim args As New CommandEventArgs(e)
End Sub 'Command_Button_Click

Remarks

Use this constructor to create and initialize a new instance of the CommandEventArgs class using the specified CommandEventArgs object.

When an instance of CommandEventArgs is created by a call to this constructor, the following properties are initialized to the specified values.

Property Initial Value
CommandName The e.CommandName parameter.
CommandArgument The e.CommandArgument parameter.
See also

CommandEventArgs(String, Object) CommandEventArgs(String, Object) CommandEventArgs(String, Object) CommandEventArgs(String, Object)

Initializes a new instance of the CommandEventArgs class with the specified command name and argument.

public:
 CommandEventArgs(System::String ^ commandName, System::Object ^ argument);
public CommandEventArgs (string commandName, object argument);
new System.Web.UI.WebControls.CommandEventArgs : string * obj -> System.Web.UI.WebControls.CommandEventArgs
Public Sub New (commandName As String, argument As Object)

Parameters

commandName
String String String String

The name of the command.

argument
Object Object Object Object

A Object that contains the arguments for the command.

Examples

The following example demonstrates how to create and initialize a new instance of the CommandEventArgs class using the specified command name and argument.

private void Command_Button_Click(Object sender, CommandEventArgs e) 
{    
    CommandEventArgs args2 = new CommandEventArgs("Sort", "Descending");      
}
   
Private Sub Command_Button_Click(sender As Object, e As CommandEventArgs)
    Dim args2 As New CommandEventArgs("Sort", "Descending")
End Sub 'Command_Button_Click

Remarks

Use this constructor to create and initialize a new instance of the CommandEventArgs class using the specified command name and argument.

When an instance of CommandEventArgs is created by a call to this constructor, the following properties are initialized to the specified values.

Property Initial Value
CommandName The value of the commandName parameter.
CommandArgument The value of the argument parameter.
See also

Applies to