protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton lb = e.Row.Cells[7].Controls[0] as LinkButton;
lb.Attributes.Add("onclick", "return confirm('是否真的删除?')");
}
}
试哈绝对OK的