zoukankan      html  css  js  c++  java
  • GridView1_RowDeleting 弹出确认对话框

    1.模板列。

    <asp:LinkButton ID="LinkButton2" runat="server" CommandName="delete" CausesValidation="False"  OnClientClick="return confirm('确认要删除吗?');">删除</asp:LinkButton>

    2.非模板列

    在RowDataBound事件中进行,若Delete按钮是LinkButton,并且在第3列,代码如下:

     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                ((LinkButton)e.Row.Cells[2].Controls[0]).Attributes.Add("onclick", "return confirm('确认删除吗?')");
            }
        }
  • 相关阅读:
    飞机大战4-我的子弹
    飞机大战3-我的飞机
    飞机大战1-分析设计
    继承
    常见题
    42个例子算法
    心跳
    tomcat
    service
    URI URL
  • 原文地址:https://www.cnblogs.com/hanxuanwong/p/5429724.html
Copyright © 2011-2022 走看看