Click here to Skip to main content
15,885,953 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi Friends,

I am looking forward to restrict outside click of Modal Popup and ask confirmation to Exit, any body can suggest me any API or working code to achieve this will be much appreciated.

Thanks a lot in advance.
Posted
Updated 26-Feb-14 17:21pm
v8
Comments
Have you tried anything?
[no name] 25-Feb-14 0:30am    
Actually i am working in an exiting project so i am not getting where i need to do
Tom Marvolo Riddle 25-Feb-14 0:34am    
Solution posted.In this, model pop get focussed. you cannot select anything other than popup.Try it
Okay. Try something first.
Anyway, do you want to use jQuery Modal or ASP.NET Ajax ModalPopupExtender?
Tom Marvolo Riddle 25-Feb-14 0:29am    
Use Css to fadeout

We need to add this function which close the Popup

C#
function o() {
                if (confirm("Do you want to Exit?")) {
                a.modal && b(".bModal." + c.data("id")).fadeOut(a.fadeSpeed, function () {
                    b(this).remove()
                });
                c.stop().fadeOut(a.fadeSpeed, function () {
                    null != a.loadUrl && a.contentContainer.empty()
                });
                e.data("bPopup", 0 < e.data("bPopup") - 1 ? e.data("bPopup") - 1 : null);
                a.scrollBar || b("html").css("overflow", "auto");
                b("." + a.closeClass).die("click." + d); b(".bModal." + d).die("click");
                h.unbind("keydown." + d); e.unbind("." + d);
                c.data("bPopup", null);
                b.isFunction(a.onClose) && setTimeout(function () {
                    a.onClose.call(c)
                }, a.fadeSpeed);
                return !1
            }
            else {
                return false;
            }
 
Share this answer
 
v2
Comments
Tom Marvolo Riddle 27-Feb-14 1:07am    
5+
 
Share this answer
 
Comments
[no name] 25-Feb-14 1:01am    
This link as no page
Tom Marvolo Riddle 25-Feb-14 1:03am    
Hi faisal,i guess you're net connection is slow.retry it.i checked it now it's working
[no name] 25-Feb-14 1:30am    
Hai Jas, What u have shown in this demo is confirmation on button click but i dont need this..

In my project all the pages are viewed inside Modal Popup iframe, and when we click outside of Modal Popup, it will Exit So i want to restrict outside click of Modal Popup and ask confirmation to Exit
Tom Marvolo Riddle 25-Feb-14 1:38am    
Now i get it faisal.I will try and let you know
[no name] 25-Feb-14 2:09am    
Thanks in advance Jas

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900