Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: double click confirm message


Message #1 by "eyetalion" <eyetalion1@h...> on Tue, 26 Nov 2002 15:37:45
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 & "?')"

  Return to Index