如何在注销之前关闭选项卡后返回用户页面? [英] How to get back the user page after closing the tab before logging out ?

查看:87
本文介绍了如何在注销之前关闭选项卡后返回用户页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户在他/她退出之前意外或故意关闭了标签,然后如果他/她打开相同的链接(ULR),他/她应该直接获取他/她的页面而无需再次登录?喜欢Facebook?

if the user closed the tab accidentally or intentionally before he/she logout and then if he/she opens the same link (ULR) he/she should get his/her page directly without the need to login again ? Like Facebook?

推荐答案

简单。在登录Page_load事件检查会话是否在那里然后重定向到主页。



你的代码片段可能看起来像



Simple. In Login Page_load event check if session is there then redirect to the home page.

Your code snippet may look like

protected void Page_Load(object sender, EventArgs e)
	{
        if (Session["UserId"]!=null)
        {
            Response.Redirect("Home.aspx");
        }
	}


这篇关于如何在注销之前关闭选项卡后返回用户页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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