asp.net-mvc-3jqueryasp.net-mvc-ajax

ASP.NET MVC 3 DateTime incorrect parsing on AJAX form submitting


I have a textbox on my AJAX form which contains date-time formatted string in date format like 'dd.MM.yyyy', for example '21.11.2011'.

When submitting the form to controller action accept null in DateTime? parameter. It happens when date day is larger than 12. If submitting textbox with value like '12.09.2011' on server side have value 09.12.2011 in DateTime? parameter. But if submit form by non-AJAX mode (Html.BeginForm) its okay.


Solution

  • Change HttpMethod to POST and all works okay. But semantically I want to use GET because there are no data changes on the server - just objects list selection.