Solved

asp .net timer without reset

Posted on 2011-03-19
2
465 Views
Last Modified: 2012-05-11
Hi-

I have a page the opens a new window (popup) to an aspx page. On the page is a test the user completes. The test is timed. I am looking for the best way to hold the time so if the user refreshes the page or navigates away from it and then comes back the timer continues to run. But, if the user closes the popup then the timer will stop.

Any help would be appreciated.
0
Comment
Question by:doctor069
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 35174182
I would think you'd keep the time the test was started in a Session parameter. On refreshes, you can calculate the difference between the new request's time and the original start time and use this as an initializer for the time displayed to your user, which would be updated via javascript once it's rendered on the client.

For the popup, you would probably want to handle the onunload event to send a request back to the server to clear the timer (i.e. remove start time from the session).
0
 

Author Closing Comment

by:doctor069
ID: 35209066
Think that is the best way.

Thanks
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question