Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup message to logout 1

Status
Not open for further replies.

JCruz063

Programmer
Joined
Feb 21, 2003
Messages
716
Location
US
Hi All
I have an ASP.NET application (website) that allows users to log on. As any other website, if the user is iddle for a specified number of minutes, he's automatically logged out. I'm using Windows Forms Authentication with cookieless sessions.

My bank's website pops up a message when I'm iddle for a given amount of time. The popup says seomthing like [tt]"You will be logged out in [x] seconds... To stay logged in, click here... To log out, click here"[/tt], and it shows a countdown of seconds until zero. How can I implement this in my own website? I'm using Visual Studio .NET 2002 with C#.

Thanks

JC

_________________________________________________
To get the best response to a question, read faq222-2244.
 
It is a basic javascript timer that you will be seeing on the bank's site. Search google for javascript timer and you will come up with millions of examples.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
<input type=text id=text1>
<script>
var counter = 60;
window.setTimeout("StartHere()",300000)
function StartHere(){
window.setInterval("CountDown()",1000);
}
function CountDown(){
if(!document.getElementById())return;
if(!document.getElementById("text1"))return;
text1.value = counter
counter = counter - 1;
if(counter<0)document.location.href="login.aspx";
}//end function
</script>
 
Thanks guys!
It isn't the timer that I'm interested in. I don't have a problem with that. What I need help with is keeping track of the user's iddle time on the server, issuing the popup window, and getting the response (if there is one) from the user to act accordingly.

Thanks!

JC

_________________________________________________
To get the best response to a question, read faq222-2244.
 
In actual fact it is the javascript timer you are interested in. Once a request has been made to the page and the page is served, you will need a javascript timer to show how long it has been since that page loaded. Once it gets down to a certain time, you can popup a message to the user and if they want to stay logged in you can post the form back to the server via javascript.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
I see... I actually thought I needed to keep track of how long ago a request was served (on the server).

Well, thanks!

JC

_________________________________________________
To get the best response to a question, read faq222-2244.
 
No problem. Have a go youself and if you get stuck we can help you out and post a quick example for you.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top