I am having some difficulty getting my message box to display. If I use a regular asp button, I place the javascript in the page_load event and it works fine. The problem is this button I'm using now is a datagrid button. Is there another procedure I can declare this code in?
Code:Public Sub DeleteBid(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.DeleteCommand 'check which row has been selected Dim selectedRow As String = DataGrid1.DataKeys(e.Item.ItemIndex) Dim btnDelete As Button btnDelete = e.Item.Cells(4).Controls(0) '<---5th column, first control btnDelete.Attributes("onclick") = "javascript:return confirm('Are you sure you want to delete \n Bid Record " & selectedRow & "?')"




Reply With Quote