首页 > 学院 > 开发设计 > 正文

ASP.NET2.0下为GridView添加服务器端删除确认!

2019-11-18 17:06:10
字体:
来源:转载
供稿:网友
PRotected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        //在服务器端添加删除确认
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
             LinkButton btnDelete = (LinkButton)e.Row.FindControl("LinkButton1");
             btnDelete.Attributes.Add("onclick", "javascript:return " +"confirm('Are you sure you want to delete this record " +DataBinder.Eval(e.Row.DataItem, "编号") + "')");
        }
     }
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表