由网友(平淡而不平凡)分享简介:我有我需要的时候会达到其超时弹出/层/警报发生(可以说10分钟)一个asp.net网站。弹出窗口会说,您的帐户会议将exprire由于不活动,并有一个按钮继续会话或注销按钮。I have an asp.net site that I need to have a popup/layer/alert happen wh...
我有我需要的时候会达到其超时弹出/层/警报发生(可以说10分钟)一个asp.net网站。弹出窗口会说,您的帐户会议将exprire由于不活动,并有一个按钮继续会话或注销按钮。
I have an asp.net site that I need to have a popup/layer/alert happen when the session reaches its timeout (lets say 10 minutes). The popup will say that your account session will exprire due to inactivity and have a button for continue session or a button for logout.
我看到不同的方式来做到这一点的在线,但什么是最好的/适当的方式来处理呢?我必须把额外的超时时间,如果弹出的是开放的时间太长?
I see different ways to do this online, but what's the best/proper way to handle this? Do I have to put an additional timeout if the popup is open too long?
推荐答案
检查这篇文章,这包含了你需要为你的要求,所有的事情
Check this article , this contains all things what you need for your requirement
警报会话超时在ASP.NET
<script language="javascript" type="text/javascript">
var sessionTimeoutWarning =
"<%= System.Configuration.ConfigurationSettings.AppSettings
["SessionWarning"].ToString()%>";
var sessionTimeout = "<%= Session.Timeout %>";
var sTimeout = parseInt(sessionTimeoutWarning) * 60 * 1000;
setTimeout('SessionWarning()', sTimeout);
function SessionWarning() {
var message = "Your session will expire in another " +
(parseInt(sessionTimeout) - parseInt(sessionTimeoutWarning)) +
" mins! Please Save the data before the session expires";
alert(message);
}
</script>
相关推荐
最新文章