Solved

Live clock and "time left" on asp.net page

Posted on 2011-03-21
6
667 Views
Last Modified: 2012-05-11
I have a asp.net page which has a date/time stored in the database. Let's say "Table1.MyDateTime", which is stored in a label called "labelMyDateTime".

How can I...
(1) Display the LIVE SERVER TIME and have it update with each second AND
(2) Display the LIVE TIME UNTIL Table1.MyDateTime/labelMyDateTime (example: "3 days, 2 hours, 15 minutes left")

Again, both needs to update each second.

Please provide sample code.

Thanks!
0
Comment
Question by:RobertNZana
  • 4
  • 2
6 Comments
 
LVL 9

Accepted Solution

by:
xav056 earned 500 total points
ID: 35185853
Date.Now would actually get you the server time to refresh every second you will have to use an update panel
check those two links out
http://ajax.net-tutorials.com/controls/timer-control/
http://www.asp.net/ajax/videos/how-do-i-get-started-with-aspnet-ajax
0
 
LVL 9

Author Comment

by:RobertNZana
ID: 35193492
The problem is that I'm using a modelpopupextender on the page and when they invoke the popup on the "tick" the popup disappears. So, that's the obstacle at the moment. Any other ideas?
0
 
LVL 9

Expert Comment

by:xav056
ID: 35195727
look at conditionally updating the update panel
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 9

Expert Comment

by:xav056
ID: 35195732
another idea
if the date is not in the pop up extender, disable the time untill the popup extender is dimissed
0
 
LVL 9

Author Comment

by:RobertNZana
ID: 35197836
can u provide code for this?
0
 
LVL 9

Expert Comment

by:xav056
ID: 35203881
just put your popup extender code in a different update panel and set the update mode on both to conditional
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 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

10 Experts available now in Live!

Get 1:1 Help Now