0

我是 asp.net 的新手..请帮助我编写设置会话超时的代码以及如何在所有页面中实现,我尝试使用 web config 方法,但没有得到,我快到最后期限了。这是我的代码

4

2 回答 2

2

从代码:

Session.Timeout = 60; // this will set 60 min timout

从配置:

<sessionState timeout="60" />
于 2013-07-31T08:29:46.363 回答
1

使用Web.config

<sessionState
timeout="number of minutes"............

完整参考这里

或者

使用Forms authentication

<system.web>
<authentication mode="Forms">
      <forms timeout="50"/>
</authentication>  
<sessionState timeout="60"  />
</system.web>
于 2013-07-31T08:29:33.110 回答