且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如果用户闲置返回登录页面.

更新时间:2023-12-01 17:19:58

您需要使用会话超时.
会话是管理ASP.Net应用程序状态的一种方法.

在此处阅读有关会话的更多信息- http://msdn.microsoft.com/zh-cn/library/ms972429. aspx [ ^ ].
在此处阅读有关状态管理的更多信息- http://msdn.microsoft.com/en-us/library/75x4ha6s .aspx [ ^ ]

http://csharpdotnetfreak.blogspot.com/2008/11/detecting-session- timeout-and-redirect.html [ ^ ]提供了一个不错的解决方案,一旦会话超时,您就可以进入登录页面.
简而言之,一旦发生超时,您就可以将应用程序指向登录页面.
You need to use a session timeout.
A Session is one way to manage state of an ASP.Net application.

Read more about Sessions here - http://msdn.microsoft.com/en-us/library/ms972429.aspx[^].
Read more about State Management here - http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx[^]

http://csharpdotnetfreak.blogspot.com/2008/11/detecting-session-timeout-and-redirect.html[^] gives a decent solution that takes you to the login page once the session times out.
In short you direct your application to point to the Login page once a timeout has occurred.