Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to check in if condition the function for confirmation box is returning yes and no?
My function in vb is given below .It is displaying a dilogue box with yes of cancel button.
VB
Public Sub UserConBox(ByVal sMsg As String)
        Dim jScript As String = "confirm('" + sMsg + "')
        ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "onclick", jScript, True)
    End Sub
Posted
Updated 9-May-12 20:27pm
v2

1 solution

Might try:

Public Sub UserConBox(ByVal sMsg As String)
Dim jScript As String = "if(confirm('" + sMsg + "')) { alert('confirmed'); } else { alert('not confirmed'); }"
ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "onclick", jScript, True)
End Sub 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900