Hello, I have a repeater with a hidden button. Using the ItemCommand Event in code behind, I used a MsgBoxStyle.OkCancel asking if user wants to continue his action. If user clicks ok, a stored procedure is called, writing some data in DB. I uploaded the application to the webserver and repleaced the MsgBox with a javascript confirm box in code behind.I'm facing two problems right now. First: How can I access the Ok Click Event from the confirm box? Second: The confirm box appears, but the page reloads as well. How can I prevent the Postback? old:
Dim intAnswer As Integer = MsgBox("Do you wish to continue?", _ MsgBoxStyle.OkCancel)If intAnswer = vbOK TheninsertData()End If
new:
Page.ClientScript.RegisterStartupScript(Me.GetType, "confirm", "confirm('Do you wish to continue?')",True) 'If user clicks ok insertData()
Thanks for your help.