删除的2次确认 ItemDataBound

private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
  {
   if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
   {
            
    LinkButton delBttn = (LinkButton) e.Item.Cells[3].Controls[0];
    delBttn.Attributes.Add("onclick","javascript:return confirm('真的要删除吗');");
   }
  } 

你可能感兴趣的:(删除的2次确认 ItemDataBound)