Here is the funny thing for me:
http://www.asp.net/mvc/tutorials/javascript/using-the-html5-and-jquery-ui-datepicker-popup-calendar-with-aspnet-mvc/using-the-html5-and-jquery-ui-datepicker-popup-calendar-with-aspnet-mvc-part-4This works great in FireFox (picker is displayed). It works in Chrome (HTML5 style picker is displayed).
But nothing!!! displays in IE for me.
Could it be that something got cached in IE9 and what's why I don't see it when debugging?
>I did my MVC app about 5 or 6 months ago and I couldn't fathom how to deal with nullable dates and the DatePicker, so I came up with this cheaty workaround:
>
>
>script type="text/javascript"
> $(function () {
> $('.datepickerClass').datepicker({ showAnim: 'drop', dateFormat: 'mm/dd/yy', showWeeks: true, higlightWeek: true }); //don't know if these options work or not
> });
>script
>
> @{
> string mydate;
> if (Model.begindate == null)
> {
> mydate = string.Empty;
> }
> else
> {
> mydate = @Model.begindate.Value.ToString("MM/dd/yyyy");
> }
> @Html.Raw("input id='begindate' type='text' name='begindate' value='" + mydate + "' class='datepickerClass'")
> }
>
>
>
>I had to remove the greater than and less than signs because it was getting messed up.
>
>But, as you can see I used @HTML.Raw()
>
>Sure, if you can figure out the templating go with that.
If it's not broken, fix it until it is.
My Blog