RepeaterCommandEventArgs.CommandSource 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取命令源。
public:
property System::Object ^ CommandSource { System::Object ^ get(); };
public object CommandSource { get; }
member this.CommandSource : obj
Public ReadOnly Property CommandSource As 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
注解
使用此属性确定命令的源。