Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 701
  • Last Modified:

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

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
RobertNZana
Asked:
RobertNZana
  • 4
  • 2
1 Solution
 
xav056Commented:
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
 
RobertNZanaAuthor Commented:
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
 
xav056Commented:
look at conditionally updating the update panel
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
xav056Commented:
another idea
if the date is not in the pop up extender, disable the time untill the popup extender is dimissed
0
 
RobertNZanaAuthor Commented:
can u provide code for this?
0
 
xav056Commented:
just put your popup extender code in a different update panel and set the update mode on both to conditional
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now