Hi, yes, AjaxPro will use "new Date(...)" serialization for DateTime by default because you may want to use the JavaScript Date object on the client-side code. There is an option to serialize DateTimes as string, see
http://weblogs.asp.net/mschwarz/archive/2006/09/22/AjaxPro-JSON-Parser-and-Dates.aspx http://codeplex.com/Wiki/View.aspx?ProjectName=AjaxPro (new option in web.config since 6.9.22.1, oldStyle/renderDateTimeAsString) The other option you have is to write your own DateTimeConverter where you define your output. Regards, Michael On 9/23/06, Jon Ceanfaglione <[EMAIL PROTECTED]> wrote: > I could be wrong, but as I understand it, AjaxPro has implemented a "custom" > method of serializing dates to the client. Given that, I have had no > problems with date serialization. I often use: var dt = new Date( > result.SomeDate); That always givs me a valid date object in javascript. > Since I always transform the date for display purposes (mm/dd/yy) myself > using a js routine it suits me just fine. > > Not sure if this helps you or not, just my experience. > > > On 9/23/06, Chris Brooksbank <[EMAIL PROTECTED]> wrote: > > > > Firstly I am very new to using JSON and think its fantastic now I can > > pass objects from servercode to browser and back. > > > > I am using the AJAX.Net Pro to output an arraylist of objects to a > > hidden text field. > > > > 1. eval() on the client works perfectly and gives me the array of > > objects. > > BUT using JSON.Orgs parseJSON() method which is presumably safer doesnt > > work. > > > > 2. If I use the JSON.Org stringifier to update the JavaScript array > > back in the hidden field then the dates all seem to disappear in the > > resulting string. This causes the AJAX.Net pro JSON deserializer to > > fall over on the serverside. > > > > Why does the JSOn.Org stringifier not handle the dates - is it because > > of the way Ajax.Net serializes dates or is it not Ajax.nets fault at > > all. WOuld be nice if they worked together. > > > > Anyway not a disaster I will just pass dates in some other format e.g > > my own custom date object with simple propertys > > > > - Chris Brooksbank > > > > > > > > > > > > > > > > > > > > > > > > > -- Best regards | Schöne Grüße Michael Microsoft MVP - Most Valuable Professional Microsoft MCAD - Certified Application Developer http://weblogs.asp.net/mschwarz/ http://www.schwarz-interactive.de/ Skype: callto:schwarz-interactive MSN IM: [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ajax.NET Professional" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/ajaxpro The latest downloads of Ajax.NET Professional can be found at http://www.ajaxpro.info/ Don't forget to read my blog at http://weblogs.asp.net/mschwarz/ -~----------~----~----~----~------~----~------~--~---
