+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Question about the DatePicker How To In the Sitefinity Documentation

Question about the DatePicker How To In the Sitefinity Documentation

2 posts, 0 answered
  1. Francis
    Francis avatar
    5 posts
    Registered:
    06 May 2009
    04 Nov 2011
    Link to this post
    Greetings,
    I'm finally updating our site from SF3.7 to SF 4.2, and have a bunch of controls in SF3.7 that I had previously created Custom designers for.  Since the upgrade path for those custom designers doesn't seem super clear, I'm resigned to recreating the control, using the new custom ContentViewDesignerBase classes.

    Anyways, I've been following along with the DatePickerField example in the How To section of sitefinity 4, and have become stuck.

    If I follow the instructions, my DatePickerField header looks like this:
    1.[ControlDesigner(typeof (DatePickerFieldDesigner))]
    2.[DatabaseMapping(UserFriendlyDataType.Date)]
    3.public class DatePickerField : FieldControl, IFormFieldControl
    4.{

    I've included my DatePicker project as a reference to my SF project, and have registered the DatePicker control in the backend. But then, when I go to a SF page to add the control, it complains that it can't find "DatePicker.DatePickerField".  So, figuring the instructions were missing a step, I added a namespace quaifler to my DatePickerField, like this:
    1.namespace DatePicker
    2.{
    3.    [ControlDesigner(typeof (DatePickerFieldDesigner))]
    4.    [DatabaseMapping(UserFriendlyDataType.Date)]
    5.    public class DatePickerField : FieldControl, IFormFieldControl
    6.    {

    Then, I no longer get the "DatePicker.DatePickerField" javascript alert in the backend, but now I get a complaint from asp.net that - 
    Assembly 'DatePicker, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not contain a Web resource with name 'DatePicker.DatePickerField.js'.

    I've got the DatePickerField.js file marked as an Embedded Resource, so I don't understand why it can't find it.

    Any direction would be awesome.

    Thanks,
    Francis

  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    08 Nov 2011
    Link to this post
    Hello Francis,

    There is a KB article describing how to create a custom DateTime picker field. Maybe it will be helpful for you - 

    http://www.sitefinity.com/devnet/kb/sitefinity-4-x/custom-datefield-allowing-custom-date-and-time-formats.aspx

    Please let us know.

    All the best,
    Lubomir Velkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

2 posts, 0 answered