DateTime Picker Custom Control Help

DateTime Picker Custom Control Help

Post by c2tpbnNmYW » Thu, 29 Mar 2007 08:59:24


I am using this custom control on a form to allow persons to pick a date and
time for a meeting request. I have changed it a little to make the Pick Date
button appear in publishing mode. When they click the button, a window opens
with the calender and they pick their date and time. When they hit OK on the
calender window, the text field displays what they picked. Once they finish
filling out the form they press submit and an email is generated. I am
having issues getting the value from this placeholder. Here is the line of
code:

string StartDate = ((HtmlPlaceholder)
CmsHttpContext.Current.Posting.Placeholders["startDate"]).text;

startDate is bound to the datetimepicker placeholder.

This returns nothing.

Can anyone enlighten me??

Thanks in advance.

David
 
 
 

DateTime Picker Custom Control Help

Post by Stefan Goe » Thu, 29 Mar 2007 17:25:39

Hi David,

in published mode you cannot write to the database.
The code below actually reads content from the database - and not from the
control.
I don't think that you are really looking for a placeholder control. You
should just use a regular ASP.NET time picker control instead.

Cheers,
Stefan