Phil Haack's blog entry describes this process using ASP.NET MVC 2's futures and Crockford's json2.js. John Resig also recommends using Crockford's json2.js in this article regarding "use strict";.
To get this feature today, would you still download the MVC 2 Futures, or is this included in the MVC 2 final, or is this part of the new MVC 3 preview?
Edit:
As Per Jakub's suggestion (and Phil Haack, woot!), my script finally works. A big appreciation to both of them.
<script type="text/javascript">
$(document).ready(function () {
var myData = {};
myData.value = '9/14/2010 12:00:00 AM';
var myJson = JSON.stringify(myData);
$.ajax({
type: "POST",
url: "/AdSketch/GetPrintProducts",
data: myJson,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
alert(result);
}
});
});
</script>
The MVC controller code:
public JsonResult GetPrintProducts(string value)
{ // At this point "value" holds "9/14/2010 12:00:00 AM"
return Json(value);
}