I am using knockoutjs on an asp.net mvc page. I am using ajax to persist a form back to the server by calling ko.toJSON(viewModel)
and then posting the results
I had a problem with ko.toJSON()
giving me a bad date format when the date was DateTime.MinValue
.
Though probably not a fix for your problem, this fix worked for my ko.toJSON()
date problem:
var postData = JSON.parse(JSON.stringify(ko.toJSON(viewModel)).replace(/\"1-01-01/g, "\"0001-01-01"));
ASP.Net WebMethod fails because ko.toJSON() produces different results for DateTime.MinValue