Private Sub datagrid1_itemdatabound(ByVal sender As System.Object, ByVal e As System.web.ui.webcontrols.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound
If (e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem) Then
Dim btndelete As LinkButton = e.Item.Cells(9).Controls(0)
btndelete.Attributes.Add("onclick", "return confirm('确定要删除这条记录吗?')")
End If
End Sub