Solved

asp .net timer without reset

Posted on 2011-03-19
2
444 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
2 Comments
 
LVL 74

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video discusses moving either the default database or any database to a new volume.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now