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());
            }
        }

 

posted @ 2012-02-06 13:55  偶不是大叔  阅读(184)  评论(0编辑  收藏  举报