confirm message box asp.net

PratikShah111
PratikShah111 used Ask the Experts™
on
I have a pop up screen with save and cancel button.
When the user clicks on cancel button I want to do the following

if (allconditionstrue)
{
show confirm message box.
if the user clicks yes , close the pop up
if user clicks no, close the message box and keep pop up open.
}
else
{
close pop up
}
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
leakim971Multitechnician
Top Expert 2014

Commented:
if(allconditionstrue)
{
       if( confirm("do you really want to?") {
       // yes close the pop up
       } else {
       // no close the message box and keep pop up open.
} else {
      //close pop up
}

Open in new window

Author

Commented:
this is not correct. code is not compiling. "confirm" needs to be defined
leakim971Multitechnician
Top Expert 2014

Commented:
corrected :
if(allconditionstrue)
{
    if( confirm("do you really want to?") ) {
        // yes close the pop up
    } else {
        // no close the message box and keep pop up open.
    }
} else {
    //close pop up
}

Open in new window

Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
leakim971 I am still getting the same error for "confirm"

Author

Commented:
are you give me javascript code or C# codebehind. I prefer doing this in C# codebehind. I want this code to be part of a button click event
did everything in javascript instead
leakim971Multitechnician
Top Expert 2014

Commented:
so not sure why you put JavaScript tag here...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial