When i post a DateTime with Json i have the following error: Error 500 Can't cast object of type "System.DateTime" to type "System.Array".
I don't understant why ! Can you help me please ?
the header send look like this :
{"MyDate":"2012-12-31T23:00:00.000Z","Param1":"aaaa","IdItem":123}
My viewModel :
public class MyViewModel
{
public DateTime MyDate { get; set; }
public string Param1 {get;set;}
public Int32? IdItem { get; set; }
}
My controller :
[HttpPost]
public void Saisie(MyViewModel model)
{ ... }
My Javascript code :
$.ajax({
url: url,
type: 'post',
dataType: 'json',
data : JSON.stringify(model),
contentType: 'application/json',
success : function() {...}
})