Calling AJAX modal popup using JavaScript

588 views Asked by At

I'm using a javascript function in window.onbeforeunload event to warn user when user exit the page. I want to call an AJAX modal popup instead of the default popup message window. When I try to use the modal popup window, default popup window is also showing with it (return false). Is there any way to block this default popup?? Please find my java script code below. Thanks, Justin

function confirmExit() {
    if (needToConfirm) {
        var optOut = 0;
        if (document.getElementById('<%= hidOptOut.ClientID%>') != null) {
            optOut = document.getElementById('<%= hidOptOut.ClientID%>').value;
        }
        if (optOut == 0 || optOut == '') {
            $find("mpe").show();
            return false
        }

    }
}
0

There are 0 answers