共用方式為


RepeaterCommandEventArgs.Item 屬性

定義

取得與事件關聯的 RepeaterItem

public:
 property System::Web::UI::WebControls::RepeaterItem ^ Item { System::Web::UI::WebControls::RepeaterItem ^ get(); };
public System.Web.UI.WebControls.RepeaterItem Item { get; }
member this.Item : System.Web.UI.WebControls.RepeaterItem
Public ReadOnly Property Item As RepeaterItem

屬性值

RepeaterItem

與事件關聯的 RepeaterItem

範例

下列範例示範如何從 Item 屬性判斷索引編號。

void R1_ItemCommand(Object Sender, RepeaterCommandEventArgs e) {
    Label2.Text = "The index of the item is " + e.Item.ItemIndex.ToString();
 }
Sub R1_ItemCommand(Sender As Object, e As RepeaterCommandEventArgs)
    Label2.Text = "The index of the item is " & e.Item.ItemIndex.ToString()
End Sub

備註

使用這個屬性來存取與此事件相關聯的 屬性 RepeaterItem

適用於

另請參閱