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
備註
使用這個屬性來判斷命令的來源。