-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: raagz
Message 4 in Discussion


Hi,
 
You 
can try this.
 
Well, 
the way to do this with IE is to use 'onbeforeunload' to call a function, and in 
that function you check the mouse position. If the mouse position for height 
(clientY) is negative (<0), you know that the mouse is above the top of the 
web page area itself, thus most likely clicking one of the browser buttons. With 
a little more work, you can probably tell whether they are clicking on the 
'close' button.
 
Then 
you use an if clause in your function:
 
if(window.event.clientY < 0){ 
// you can use a more complex clause 
here
 
event.returnValue = "Your message here";
//This opens IE's custom 
dialog prompting 
//the users to confirm whether they want to 
//navigate 
away from the page or not.
 
{Whatever other code you want to run}
 
}
 
and 
also  When the IE broswer is closed (I cheched for v. 5.0 and 
6.0) the window is moved to position screenTop>10000 and 
screenLeft>10000.
use this to invalidate session. It also works with 
keyboard's close window hotkey. 
 
function onClose(){
 
if(window.screenTop>10000){
alert("window.onClose 
works!")
}
}
window.onunload=onClose
 
Hope 
this helps you.
 
Thanks
Raghavendra
 
 

  -----Original Message-----
From: pratap_ms 
  [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 05, 2004 11:28 
  AM
To: BDOTNET
Subject: browser close 
  event


  
    
      
      New Message on BDOTNET
    
      

  browser 
    close event


    
      
      
        Reply

        
          
            
            
               
              Reply to Sender   Recommend 
              Message 1 in 
                Discussion 
      
        
          
            
            
              From: pratap_ms 
            
              

                I have a requirement in ASP.net to update a database table 
                once the browser is closed using browser's close(X) button. How 
                to handle this problem? Any code example on this is much helpful 
                for me.
View other groups in this 
    category. 



-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to