ASP.NET网站的会话问题

发布于 2024-08-13 11:24:14 字数 183 浏览 1 评论 0原文

我有一个asp.net网站,其中没有实现会话的地方。

但是当我在生产服务器中部署后访问网站时,我可以看到会话超时...

我检查了 web.config 文件中的会话条目...并在代码中搜索了会话...

我找不到该条目...

现在我想在会话超时时放置一个消息框..如何做到这一点..请帮助!

I have an asp.net website, where there is no where session is implemented.

But i could see the session is timing out when i take the website after deploying in the production server ...

i checked the session entries in the web.config file... and searched session in the code..

nowhere i find the entry...

now i want to put a message box while session timeout ..how to do this..please help!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

骑趴 2024-08-20 11:24:14

你可以在你的 web.config 中检查这个并增加时间...

<sessionState timeout="20"></sessionState>

还要检查你的 sessionStatemode...

<sessionState mode="InProc"></sessionState>

you could check this in your web.config and increase time...

<sessionState timeout="20"></sessionState>

also check your sessionStatemode...

<sessionState mode="InProc"></sessionState>
耳钉梦 2024-08-20 11:24:14

将其放入您的 aspx html 代码中

<script language="javascript" type="text/javascript">
    setTimeout('SessionTimeout()', <%= Session.Timeout * 60 * 1000 %>);
    function SessionTimeout() {
        alert(<%= "'Session time out!!'" %>);
        window.location = "Default.aspx"
    }
</script>

Put this in your aspx html code

<script language="javascript" type="text/javascript">
    setTimeout('SessionTimeout()', <%= Session.Timeout * 60 * 1000 %>);
    function SessionTimeout() {
        alert(<%= "'Session time out!!'" %>);
        window.location = "Default.aspx"
    }
</script>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文