用户关闭浏览器时如何重定向到“登录”页面 [英] Howto Redirect to the Login page when the User close the Browser

查看:135
本文介绍了用户关闭浏览器时如何重定向到“登录”页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网页位于母版页内,如果用户关闭浏览器而不点击退出链接,我想重定向到登录页面。我怎么能这样做。

My website pages are inside the Master Page, I want to redirect to the Login page if the user close the browser without clicking the Logout Link. How can I do it.

推荐答案

不能重定向到登录页面,因为浏览器窗口将被关闭。 br />


使用 onbeforeunload事件 [ ^ ]注销用户而不重定向。
You can't redirect to Login page, because the browser window is going to be closed.

Use onbeforeunload event[^] to logout user without redirecting.


这篇关于用户关闭浏览器时如何重定向到“登录”页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆