So I have an ASP.NET grid view:
In RowDataBound add -
RowDataBound
LinkButton objDelete = e.Row.Cells[0].Controls[0] as LinkButton; objDelete.Attributes.Add("onclick", "javascript:return confirm('Do you want to delete this item?');");