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
Solved

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

Posted on 2011-03-21
6
672 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
No Data for DropDown List 2 28
How come this regular expression allows "e"? 14 45
FInd Image Control Gridview 3 20
exporting html table data 4 27
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

808 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