Repeater控件中添加删除按钮方法:
1: <ASP:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%#Eval("id") %>' OnClientClick="return confirm('是否删除')" OnClick="Del" >删除</asp:LinkButton>
2:在后台中添加删除方法
public void Del(object sender,EventArgs e)
{
int id = Convert.ToInt32((sender as LinkButton).CommandArgument);
//把sender由object转换成LinkButton后获取CommandArgument的值
new xh.shop.DAL.link().Delete(id);
Repeater1.DataSource = new xh.shop.DAL.link().GetList("");
Repeater1.DataBind();
}