我想访问与其中启动ItemCommand的RepeaterItem关联的数据。该方案是,我有一个Button控件在命令设置声明这样多RepeaterItems:在命令执行中访问与RepeaterItem相关联的数据
<asp:Repeater ID="Repeater3" runat="server" DataSource='<%# ClientManager.GetClientEmployees(Eval("ClientID")) %>' OnItemCommand="RemoveEmployeeFromClient">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" Text="(x)" CommandName="RemoveEmployeeFromClient"></asp:LinkButton>
</ItemTemplate>
<SeparatorTemplate>,<br /></SeparatorTemplate>
</asp:Repeater>
后面的代码是:
Protected Sub RemoveEmployeeFromClient(ByVal source As Object, ByVal e As RepeaterCommandEventArgs)
' I want to access the data associated with the RepeaterItem which the Button was clicked.
End Sub