Welcome Guest Search | Active Topics | Sign In | Register

Datepicker not sending time value Options
loons
Posted: Tuesday, November 25, 2008 2:58:39 PM
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="
&lt;style type=&quot;text/css&quot;&gt;
eo_support
Posted: Tuesday, November 25, 2008 3:17:13 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,097
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!
loons
Posted: Tuesday, November 25, 2008 3:20:30 PM
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.
eo_support
Posted: Tuesday, November 25, 2008 3:27:54 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,097
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
loons
Posted: Tuesday, November 25, 2008 3:35:58 PM
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!
eo_support
Posted: Tuesday, November 25, 2008 5:32:11 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,097
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.