WEB开发网
开发学院WEB开发ASP.NET ASP.NET2.0下为GridView添加服务器端删除确认! 阅读

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

 2006-07-19 17:10:25 来源:WEB开发网   
核心提示:PRotected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { //在服务器端添加删除确认 if (e.Row.RowType == DataControlRowType.DataRow) { LinkButton b
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, "编号") + "')");
     }
   }

Tags:ASP NET GridView

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接