I have an object, it has a DateTime property... I want to pass that object from an .ashx handler back to a webpage via AJAX/JSON... I don\'t want to use 3rd party controls..
the answer is: you can't use JavaScriptConverter this way... it doesn't have the capabilities.
but for reference:
How do I format a Microsoft JSON date? http://blog.stevenlevithan.com/archives/date-time-format
If you care, what I ended up doing was adding a method to the javascript string prototype to make this easier for me in code:
String.prototype.dateFromJSON = function () {
return eval(this.replace(/\/Date\((\d+)\)\//gi, "new Date($1)"));
};
this is still painful to use in the meat of the code because you have to constantly call dateFromJSON() all over the place... which is dumb.