call this function from page_unload() so when user will close the browser either by [X] button or by alt+f4 or from exit (from file menu). by using this function you can detect that browser is going to close and you can perform any of your choice operation just before browser get close.
function CheckBrowser()
{
// Check Browser Close [X] , Alt+F4 , File -> Close
if(window.event.clientX < 0 && window.event.clientY <0)
{
window.open("Operation.aspx",
"Operation",'left=12000,top=1200,width=10,height=1');
}
}
How to detect browser close button is clicked ?
Posted by
Rajesh Rolen
at
Monday, November 16, 2009
Labels: ASP.NET , ASP.NET Interview Questions , Browser
1 comments:
USA
Post a Comment