Lookin for web timer sample

M

Mick

Hi,
Tryin to do exam web app.
I need to insert a timer in my app just to check the time the user did to
pass the exam.

There's just one page which reload for each question until the last one.
How could I do that ?

Thks for help.
 
K

Karl Seguin

Well, the first time the user loads the page, load the current time
(System.DateTime.Now) into something (talk about that in a bit). The last
time, you can do something like:

dim seconds as int = DateTime.Now.Subtract(StartTime).TotalSeconds

About where to store the start time. As far as I'm concerned, it's a
security issue. For performance, you can store it in the viewstate or a
form field (same difference), but then the value could be changed by the
user. Depending on the environment, that might by very unlikely. If this
isn't tolerable, you'll need to use a server-side persistence mechanism,
such as a database or a session.

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top