160
rated 0 times
[
161]
[
1]
/ answers: 1 / hits: 58108
/ 12 Years ago, sun, march 18, 2012, 12:00:00
I want to alert the user that the session timeout is about to expire. I want to have a popup with an OK button and show the seconds ticking down on the popup. Can i do this with just java script?
Im OK with using C# code behind also.
Right now it detects session timeout and pops up telling them the session has expired.
<script type=text/javascript>
var sessionTimeout = <%= Session.Timeout %>;
function DisplaySessionTimeout() {
sessionTimeout = sessionTimeout - 1;
if (sessionTimeout >= 0)
window.setTimeout(DisplaySessionTimeout(), 60000);
else {
alert(Your current Session is over due to inactivity.);
}
}
</script>
More From » c#