Link to home
Start Free TrialLog in
Avatar of PratikShah111
PratikShah111

asked on

confirm message box asp.net

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
}
Avatar of leakim971
leakim971
Flag of Guadeloupe image

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

Avatar of PratikShah111
PratikShah111

ASKER

this is not correct. code is not compiling. "confirm" needs to be defined
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

leakim971 I am still getting the same error for "confirm"
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
ASKER CERTIFIED SOLUTION
Avatar of PratikShah111
PratikShah111

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
so not sure why you put JavaScript tag here...