Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Has anybody implemented to open a popup window when we click Browser close Or window tab close Or when we navigate to different page?
Posted
Updated 7-Jan-13 23:27pm
v3
Comments
_Amy 8-Jan-13 5:28am    
Why? You'll hire him for your work?(Just Kidding) ;)

Try using:
JavaScript
window.onUnLoad= function (evt) {  
    window.open("yourpage");
}

It will be called on onUload event of browser.
Check the links below:
http://stackoverflow.com/questions/1025935/capture-event-onclose-browser[^]
http://stackoverflow.com/questions/1631959/browser-window-close-event[^]


--Amit
 
Share this answer
 
Hi,

You can use
C#
window.onbeforeunload = function(e) {
//Open popup here
window.stop();
};


It will show the popup when you navigate from the current page. If further info please do some google and you will find your answer.

Thanks!
 
Share this answer
 
Comments
Masoom Mir 8-Jan-13 6:48am    
Thanks for your solution but it doesn't work when i put code for popup like window.open("pagename.aspx");
Satyendra Kumar(Analyst Programmer) 8-Jan-13 7:03am    
If you can explain your exact requirement then may be I can help you on this.

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