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,507 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now