ListView 内的中继器:如何绑定命令并调用它?

Repeater inside a ListView: how to bind a command and call it ?

场景:我在 ListView 中有一个 Repeater。 在中继器内部我有一个 LinkBut​​ton;这是语法

<asp:LinkButton runat="server" ID="lnkRemoveComment" Text="Delete" Visible='<%# CheckVisibility() %>' CommandName="DeleteComment" CommandArgument='<%# Eval("id")%>'> </asp:LinkButton>

我不知道在服务器端代码中调用的语法:

我不知道,因为转发器嵌套在 ListView 中。 在 ListView ItemCommand 中插入代码无效!

谢谢

示例:

.aspx
------------------ 
<asp:Repeater ID="Repeater1" runat="server">
    <ItemTemplate>
        <asp:LinkButton ID="LinkButton1" runat="server" OnCommand="LinkButton1_Command" CommandName="MyUpdate" CommandArgument='<%# Eval("erid") %>'>LinkButton</asp:LinkButton>
    </ItemTemplate>
</asp:Repeater>


.cs
------------------
protected void LinkButton1_Command(object sender, CommandEventArgs e)
{
    if (e.CommandName == "MyUpdate"){
        //e.CommandArgument --> contain the erid value
        //Do something
    }
}