【发布时间】:2010-12-10 08:00:41
【问题描述】:
大家好。在我的 MVC 应用程序中,我试图重定向到登录页面,但是它没有重定向并且我收到“服务器错误”。
这里是javascript:
<script type="text/javascript">
function keepAlive() {
window.clearTimeout(window.sessionKeepAlive);
window.sessionKeepAlive = window.setTimeout(function() {
if(confirm('refresh session?')) {
// submit coding required
} else {
//window.location="/Employee/~/Account/LogOn"
//location.replace("/Employee/~/Account/LogOn");
window.location.href = '<%= Url.Action( "Logout", "Account" ) %>';
}
}, <%= (Session.Timeout - 19) * 60 * 1000 %>);
}
keepAlive();
</script>
另外,如果用户按下“确定”按钮并继续,我需要代码。
【问题讨论】:
-
您遇到了服务器错误,真的,不是在开玩笑吗?让我们玩一个游戏:第一个猜出服务器错误的人赢得免费啤酒。你的最后一句话也很难理解。
-
重定向后可能会出错
-
当我点击取消按钮时,它应该进入登录页面,但它没有去
标签: javascript asp.net-mvc session-timeout