Creating timers

  • Thread starter Simon Jefferies
  • Start date
P

Patrice

How is the timer declared ? An ASP.NET page just lives the time of the
browser request giving no chance to handle this from an ASP.NET page. You'll
have to use instead a variable whose lifetime is not limited to the ASP.NET
page...

You could also explain why you do this for perhaps possible alternatives ?

Patrice
 
P

Patrice

A timer is not for getting the current datetime. It is to raise an event
after a given elapsed time (which is not possible in an ASP.NET page that is
disposed once executed).
Just feed your textbox with System.DateTime.Now (note also this is server
side time i.e not necessarily the current local time for the user).

If you want to display and update continously the datetime you'll have
anyway to do that client side using JavaScript (having the server refreshing
the page would be really too inconvenient as it would likely came accross
what the user does and it would be a bad usage of the server resources).
Note also that the time is moft often displayed in Windows...

Patrice
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top