Solved

Why is the CalendarExtender from the Ajax Control Toolkit preventing a DateTime to display correctly in a textbox?

Posted on 2008-10-19
2
1,515 Views
Last Modified: 2012-06-21
I'm using the ajax control toolkit's CalendarExtender to provide datetimepicker functionality on a web page.
The extended control is a textbox, and the DateTime format is "MM/dd/yyyy hh:mm tt".
When the page loads, the code-behind places DateTime.Now.ToString("MM/dd/yyyy hh:mm tt") into the textbox.
Instead of seeing DateTime.Now with the correct time, I see it with 12:00 AM as the time.
so if DateTime.Now was "12/21/2008 3:34 PM", it would display as "12/21/2008 12:00 AM".
Note that when I remove the CalendarExtender the problem disappears.

The control is defined like this:
<cc1:CalendarExtender ID="dtp1" runat="server" TargetControlID="txt1" Format="MM/dd/yyyy hh:mm tt" OnClientDateSelectionChanged="function hideCalendar(cb) { cb.hide(); }" />
0
Comment
Question by:colonel720
[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
2 Comments
 
LVL 18

Accepted Solution

by:
David Robitaille earned 500 total points
ID: 22767310
0
 
LVL 1

Author Closing Comment

by:colonel720
ID: 31507672
Ah ok, thanks.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

688 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