colonel720
asked on
Why is the CalendarExtender from the Ajax Control Toolkit preventing a DateTime to display correctly in a textbox?
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" OnClientDateSelectionChang ed="functi on hideCalendar(cb) { cb.hide(); }" />
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/
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" OnClientDateSelectionChang
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER