This documentation is archived and is not being maintained.

RepeaterCommandEventArgs.CommandSource Property

Gets the source of the command.

[Visual Basic]
Public ReadOnly Property CommandSource As Object
public object CommandSource {get;}
public: __property Object* get_CommandSource();
public function get CommandSource() : Object;

Property Value

The command source.


Use this property to determine the source of the command.


[Visual Basic, C#, C++] The following example demonstrates how to determine the command source from the CommandSource property.

[Visual Basic] 
Sub R1_ItemCommand(Sender As Object, e As RepeaterCommandEventArgs)
    Label2.Text = "The " & CType(e.CommandSource, Button).Text & _
       " button has just been clicked; <br>"
End Sub

void R1_ItemCommand(Object Sender, RepeaterCommandEventArgs e) {        
    Label2.Text = "The " + ((Button)e.CommandSource).Text + " button has just been clicked; <br>";

void R1_ItemCommand(Object* /*Sender*/, RepeaterCommandEventArgs* e) {
    Label2->Text = String::Format( S"The {0} button has just been clicked; <br>", (dynamic_cast<Button*>(e->CommandSource))->Text );

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


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

See Also

RepeaterCommandEventArgs Class | RepeaterCommandEventArgs Members | System.Web.UI.WebControls Namespace