Griview中的删除按钮添加“确认提示”
<ItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="dele" Text="删除" CommandArgument='<%#Eval("EmpNo") %>' OnClientClick="return confirm('是否确认删除?')"></asp:LinkButton> </ItemTemplate>
后台代码:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "dele")//删除 { string empno = e.CommandArgument.ToString(); user.admin_delete(empno); show(txtempno.Text.Trim()); } }