Solved

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

Posted on 2009-03-31
2
259 Views
Last Modified: 2012-05-06
Hi

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

Thanks
0
Comment
Question by:patelajk
  • 2
2 Comments
 
LVL 23

Expert Comment

by:apresto
ID: 24027144
You can do this like this

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

Open in new window

0
 
LVL 23

Accepted Solution

by:
apresto earned 125 total points
ID: 24027145
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question