I need to call a pagemethod when the user closes the browser or active tabs of a particular ASP.NET 4.5.1 website, tried onbeforeunload, it is working sometimes but not consistent. Can anybody help me on this?
Dealt with this problem long back.
x
sec/minutes, closed his session (managed with sessiontimeout
, cookies
). Problems faced with browser trust.
You have to make the request a synchronous AJAX (pretty much the only circumstance in which synchronous AJAX is appropriately used); otherwise, it is a race whether the window will die before it manages to send a request or not.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.