Solved

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

Posted on 2011-03-21
6
685 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
[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
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

627 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