I am developing an asp.net mvc3 project on Windows 7, vs 2010. I have added jquery and jquery ui project links.
I have a form that stores data in a database. In my form, I have a text box that linked an editor template to select a date.
If I publish the project on my computer (Windows 7 IIS 7), everything will work correctly. But when I upload the published project to the server (Windows 2003 IIS 6), the date pick value is the wrong error.
Editor Template
@model Nullable<System.DateTime> @Html.TextBox( "", Model.HasValue ? Model.Value.ToString("dd.MM.yyyy") :string.Empty, new { data_datepicker = true, @class = "text-box " })
Javascript code for datepicker format
$ (document) .ready (function () {
$.datepicker.setDefaults($.datepicker.regional['tr']); $.datepicker.setDefaults({ changeMonth: true, changeYear: true, dateFormat: "dd.mm.yy", minDate: 0 }); $(":input[data-datepicker]").datepicker();
})
Action of my post
public ActionResult Create(FormViewModel formModel) { }
FormViewModel contains name and date properties. I thiks Model binder does not bind date. because the name property field is true, the date property gets an error.
Error: The value "18.07.2012" is not valid for EndDate.]
source share