ASP.NET2.0下为GridView添加服务器端删除确认!
时间:2009-06-30 17:02:30
作者:互联网
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//在服务器端添加删除确认
if (e.***.RowType == Da***ontrolRowType.DataRow)
{
LinkButton btnDelete = (LinkButton)e.***.FindControl("LinkButton1");
bt***lete.Attributes.Add("onclick", "javascript:return " +"confirm('Are you sure you want to delete this record " +Da***inder.Eval(e.***.DataItem, "编号") + "')");
}
}