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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 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

21 Experts available now in Live!

Get 1:1 Help Now