如何重定向用户会话时默认的首页输出asp.net 3.5 [英] how to redirect user to default page on session time out in asp.net 3.5

查看:153
本文介绍了如何重定向用户会话时默认的首页输出asp.net 3.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想当会话在asp.net 3.5已过期用户重定向到主页(Default.aspx的)。
我只是做它的Web用户的控制,但钢材它没有很好地工作。所以我只是想web.config中做到这一点。

i just want to redirect user to Home Page(Default.aspx) when session has been expired in asp.net 3.5. i just do it with web user control but steel it's not work perfectly. so i just want to do it with web.config.

<authentication mode="Forms">
  <forms loginUrl="~/SignIn.aspx" protection="All" timeout="2880" path="/" />
</authentication>

这是技术,.NET框架3.5应用程序的工作。

Is this technique works in .net 3.5 framework application.

推荐答案

如果您正在使用的形式的认证,然后你没有写任何定制code。对于会议是由框架本身提供的超时设置。只要改变配置文件下提到:

If you are using form authentication then you don't have to write any custom code. For session timeout settings are provided by Framework itself. Just change the configuration file as mentioned below :

<authentication mode="Forms">
    <forms defaultUrl="~/Default.aspx"
        loginUrl="~/Login.aspx"
        slidingExpiration="true"
        timeout="60" />
</authentication>

以上配置将在会话到期用户重定向到登录页面。

Above configuration will redirect user to the login page when session expires.

这篇关于如何重定向用户会话时默认的首页输出asp.net 3.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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