|
Rank: Newbie Groups: Member
Joined: 1/28/2008 Posts: 6
|
I am using a datepicker with a time format. The formatting works fine, but when the date/time is posted back to the server it does not include the time value so it is returned as 12:00. It works fine without the control, so it is not a database problem.
<eo:DatePicker runat="server" ID="a1date" runat='server' DataType="DateTime" PickerFormat="MM/dd/yyyy hh:mm:ss tt" VisibleDate="2008-11-01" DayCellHeight="14" DayCellWidth="22" SelectedDates="2008-11-25" SelectedDateString='<%# Bind("a1date") %>' DisabledDates="" DisableWeekendDays="True" CssBlock=" <style type="text/css">
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You want to clear SelectedDateString. That can cause problem for you. We tested it without that and it worked fine. You also may want to verify the value before saving into your DB, for example, check a1date.SelectedDate.Hours in debugger before saving into the database.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 1/28/2008 Posts: 6
|
I am not sure what you mean by clear SelectedDateString. I thought this is where you bind to the database.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The binding is one way only. In another word, it won't save the change back to the DB for you, instead it will pull it from the DB every time the page loads, which is obviously not what you want because it would wipe out whatever the user filled in. So you may just want to set the initial value by code in your Page_Load once (inside if (!Page.IsPostBack) block).
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 1/28/2008 Posts: 6
|
You have got to be kidding. I have been using the rjs popup control which is set up for binding very easily. Unfortunately it does not have a time format...ugh!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Oops! I did not notice you were using bind syntax. I thought you were using the old eval syntax. Bind syntax should be bi-directional and if it misses the time part, it would seem to be a problem with the SelectedDateString not including the time values. We will look into that and see what we can find. Sorry about that!
Thanks!
|
|