[英]Call Page Method on Browser Close
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. 当用户关闭特定ASP.NET 4.5.1网站的浏览器或活动选项卡时,我需要调用pagemethod,尝试onbeforeunload,它有时工作但不一致。 Can anybody help me on this?
有人可以帮我这个吗?
Dealt with this problem long back. 长期处理这个问题。
x
sec/minutes, closed his session (managed with sessiontimeout
, cookies
). x
秒/分钟的请求,则关闭其会话(使用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); 您必须使请求成为同步AJAX(几乎是唯一适用于同步AJAX的情况); otherwise, it is a race whether the window will die before it manages to send a request or not.
否则,在设法发送请求之前窗口是否会死亡是一场竞赛。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.