repeater删除数据 LinkButton

在repeater的某一列放入一个按钮,把按钮的e.CommandName设置为“del”,e.CommandArgument设置你要删除的主键,例如

<asp:LinkButton ID="lbtnDel" runat="server" CommandArgument='<%#Eval("id")%>' CommandName="del">删除</asp:LinkButton>


然后再rrepeater的
ItemCommand事件里写如下代码
protected void rptEducationalList_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.CommandName == "del")
{
删除的主键=e.CommandArgument.tostring();
删除的方法;
}
}
技术文档
原文地址:https://www.cnblogs.com/ishibin/p/2796013.html