TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mukesh
NA
228
42.5k
Jquery countdown warn user 5 minutes before time over
May 5 2021 12:01 PM
i want to know how to show alert model pop up when user do nothing in web editor 5 min before
i am trying through web config
please help-
<body>
<form id="form1" runat="server">
<h3>
Session Idle: <span id="secondsIdle"></span> seconds.</h3>
<div id="dialog">
Your Session will expire in <span id="seconds"></span> seconds.<br />
Do you want to reset?
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(function () {
$("#dialog").dialog({
autoOpen: false,
modal: true,
title: "Session Expiring",
buttons: {
Ok: function () {
ResetSession();
},
Close: function () {
$(this).dialog('close');
}
}
});
});
function SessionExpireAlert(timeout) {
var seconds = timeout / 1000;
$("#secondsIdle").html(seconds);
$("#seconds").html(seconds);
setInterval(function () {
seconds--;
$("#secondsIdle").html(seconds);
$("#seconds").html(seconds);
}, 1000);
setTimeout(function () {
//Show Popup before 20 seconds of timeout.
$('#dialog').dialog('open');
}, timeout - 20 * 1000);
setTimeout(function () {
window.location = "Expired.aspx";
}, timeout);
};
function ResetSession() {
//Redirect to refresh Session.
window.location = window.location.href;
};
</script>
</form>
</body>
--------------------------------------------------------------------------------------------------------------------------
Response.Cache.SetCacheability(HttpCacheability.NoCache);
if (!this.IsPostBack)
{
Session["Reset"] = true;
Configuration config = WebConfigurationManager.OpenWebConfiguration("~/Web.Config");
SessionStateSection section = (SessionStateSection)config.GetSection("system.web/sessionState");
int timeout = (int)section.Timeout.TotalMinutes * 1000 * 60;
ClientScript.RegisterStartupScript(this.GetType(), "SessionAlert", "SessionExpireAlert(" + timeout + ");", true);
}
---------------------------------------------------------------------------------------------------------------------------
<sessionState mode="InProc" timeout="6" />
Reply
Answers (
1
)
Passing InnerHTML to Another Page in javascript
SQL Query to Linq