Modal Popup - Do Not Trigger if "Cancel" button is clicked


I have a ModalPopup on my page which is linked to a command button. The button has a onClientClick event which displays a javascript confirm.

What I am trying to do is that when the js confirm appears it only appears when "OK" is clicked and doesn't appear when "Cancel" is clicked

Any ideas

Who is Participating?
You can do this like this

if ( confirm("Click ok to continue, cancel to return") )
    alert("The user clicked OK!");
    alert("The user clicked CANCEL");

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.