Solved

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

Posted on 2011-03-21
6
673 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

685 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