Iron Speed Technical Forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
abdo1984

Registered:
Posts: 93
Reply with quote  #1 
what event fire when close site or browser
timt

Avatar / Picture

Iron Speed MVP
Registered:
Posts: 556
Reply with quote  #2 
Hi

You can catch via javascript when the window closes. Not so easy with the app unless someone explicitly logs out for example. Most users will wander off leaving the browser open or the app open. Thats why after 20 mins the session closes which is like your app closing. Of course users don't see this as such unless you remind them that the session has expired and that they should refresh the page and/or login as needed.

Its a different beast from windows apps and they way they work. you have to think stateless and disconnected which makes this much harder.

what is it you are trying to do that needs this information?

HTH

__________________
Tim Titchmarsh Iron Speed Consultant MVP
London UK based
+44 (0)1621 835002
http://www.lightspeeditsolutions.co.uk/dotnetarchitect
timt@dotnetarchitect.co.uk
timt@lsits.co.uk
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,966
Reply with quote  #3 
If you are using Net 4.0 or higher, you can find better way using Session_End event at Global.asax


Jimi J 

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

porphi

Registered:
Posts: 648
Reply with quote  #4 
On the client side set a javascript event onbeforeunload with your custom javascript routine (yourBeforeUnload);

If (window.body) {
     // IE
     window.body.onbeforeunload = yourBeforeUnload;
}
 else {
    // FX
    window.onbeforeunload = yourBeforeUnload;
}

__________________
Thank you,
Phil Porter
PPG&A, INC.
pporter@ppgainc.com
http://www.ppgainc.com
https://rapidsprout.com
678-362-2035
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement