Solved

asp .net timer without reset

Posted on 2011-03-19
2
467 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

695 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