I am trying to do a very simple task: get an MVC model, and send it back to server as JSON. I tried
@Html.Raw(Json.Encode(Model));
When debugging the JS, I see that the date objects on the serialized JSON look like: /date (00064321)/
and when passing the serialized JSON to the server, the dates are null on the server-side. Anyone understand what is going on?
Instead of JSON encoding the model directly you have to create an anonymous object converting the date-time properties to strings.
Ex.
Passing directly the model..
produces
and
produces
as expected.