前台
復制代碼 代碼如下:
<asp:LinkButton ID="delLinkButton" runat="server" OnClientClick='return confirm("確定刪除?")'
CommandName="del" CommandArgument='<%# Eval("ID") %>'>刪 除</asp:LinkButton>
後台:
復制代碼 代碼如下:
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.CommandName == "del")
{
//刪除的方法
}
}