Place this code in the page_load Event…
cmdDone.Attributes("OnClick") = "return confirm('Are You Sure');"
Or in a DataGrid’s ItemDataBound Event…
Dim B As Button
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
B = CType(e.Item.FindControl("cmdDelete"), Button)
B.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this record?');")
End If