RepeaterCommandEventArgs.CommandSource 属性

定义

获取命令源。

public:
 property System::Object ^ CommandSource { System::Object ^ get(); };
public object CommandSource { get; }
member this.CommandSource : obj
Public ReadOnly Property CommandSource As Object

属性值

Object

命令源。

示例

以下示例演示如何从 CommandSource 属性确定命令源。

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

注解

使用此属性确定命令的源。

适用于

另请参阅