Command field showing messagebox

后端 未结 1 1807

I have a command field like this,


Now on

相关标签:
1条回答
  • 2021-01-27 14:51

    if delete CommandField is on second column of your grid view

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
    
            LinkButton link = (LinkButton)e.Row.Cells[4].Controls[2];
            if (link != null)
            {
                link.OnClientClick = "return confirm('Do you really want to delete?')";
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题