I have delete buttons in my datagrid. Before the record is deleted I use
the the javascript return confirm to verify if the correct record has
been selected. This all works fine except the delete button always has to
be clicked twice before the message box is diplayed. Any suggestions?
Public Sub DeleteBid(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
DataGrid1.DeleteCommand
Dim selectedRow As String = DataGrid1.DataKeys(e.Item.ItemIndex)
Dim btnDelete As Button
btnDelete = e.Item.Cells(4).Controls(0) '<---2nd column, first
control
btnDelete.Attributes("onclick") = "javascript:return confirm('Are
you sure you want to delete \n Bid Record " & selectedRow & "?')"