I am using ASP.NET MVC 3 with razor and the latest version of the Telerik MVC extensions controls.
I have a date picker on my view:
<td><label>From:</label></td>
<td>
@(Html.Telerik()
.DatePickerFor(x => x.HospitalisedStartDate)
.Name("HospitalisedStartDate")
)
</td>
This property in my view model:
public DateTime? HospitalisedStartDate { get; set; }
When the view loads, I would click on the calendar icon. The calendar pops up, I would select a date and then nothing happens. The calendar disappears but the date is not set the textbox. Why would this be? If I were to type in the word “today” in the textbox then it will put in todays date like “2012/01/21”. What am I missing here that is preventing it from working?
The markup looks like this for the style sheets and JavaScript:
<link type="text/css" href="/Content/2011.3.1115/telerik.common.min.css" rel="stylesheet"/>
<link type="text/css" href="/Content/2011.3.1115/telerik.webblue.min.css" rel="stylesheet"/>
<link type="text/css" href="/Content/Stylesheets/mystylesheet.css" rel="stylesheet"/>
<script src="/Scripts/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="/Scripts/2011.3.1115/telerik.common.min.js"></script>
<script type="text/javascript" src="/Scripts/2011.3.1115/telerik.tabstrip.min.js"></script>
<script type="text/javascript" src="/Scripts/2011.3.1115/telerik.calendar.min.js"></script>
<script type="text/javascript" src="/Scripts/2011.3.1115/telerik.datepicker.min.js"></script>
<script type="text/javascript" src="/Scripts/2011.3.1115/telerik.treeview.min.js"></script>
There seems to be an issue with the date picker when using jQuery 1.7 and higher. I changed it to jQuery 1.6.4 and it works now. Does any body know why this is the case?
This is now in my view: