会话上的页面重定向到期 [英] Page redirection on session expire

查看:95
本文介绍了会话上的页面重定向到期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在会话到期时重定向登录页面上的当前页面我已经尝试了一些代码和Web配置设置但它无法正常工作。请帮忙解决这个问题

I want to redirect current page on login page on session expiration I have tried some code and web config setting but its not working. please help to solve this problem

推荐答案



你可以在你的web.config文件中写下以下代码。




you can write below code in your web.config file.

<system.web>
 <authentication mode="Forms">
     <forms loginUrl="login.aspx" timeout="600" protection="All"/>
 </authentication></system.web>





希望这会对你有所帮助。如果有帮助,请标记为解决方案。



谢谢,

kk



hope this will help you. please mark as solution if help u.

thanks,
kk


试试这个

try this
if(session["userid"]==null)
{
//redirect your page
}


这可能有所帮助你

检测会话超时并重定向到主页 [ ^ ]

如何在ASP.NET中的会话超时(当页面包含Ajax UpdatePanel时)重定向到另一个页面 [ ^ ]

重定向前有警报 ASP.NET中的警报会话超时 [ ^ ]
this might help you
Detecting Session Timeout and Redirect to HomePage[^]
How to Redirect to Another Page when Session Timeout in ASP.NET (when pages contain Ajax UpdatePanel)[^]
before redirecting have a alert Alert Session Time out in ASP.NET[^]


这篇关于会话上的页面重定向到期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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