Sunday, March 11, 2012

Dates changed again??

Jonesie,

Are you using separate script files (for debuggin purposes maybe?) It sounds like your script files my be out of sync with the RTM assemblies. Try deleting your temporary asp.net files, as well as your temporary internet files. If you are using local script files for one reason or another, be sure to update them with the RTM scripts.

-Tony


Hi

the ajax library files are all dated 20 Jan which is the rtm version. The cache is cleared so I dont think that's it either. I probably need to test this more...

Thanks


I took a look at the ajax debug script, and everything looks correct for deserialization. The regex in there matches the new format /number. Maybe you can try stepping through the code, putting a breakpoint in the deserialize function to see perhaps what is going wrong.

I've tried this on a couple of machines now so I'm sure it's not the installation. The following demonstrates the issue.

Create a page and add script manager.

Add the following script:

debugger;

var datestr ='<%= GetDate() %>';
var datetype = Sys.Serialization.JavaScriptSerializer.deserialize(datestr);

In the codebehind add:

protected

string GetDate()
{
JavaScriptSerializer jss =new JavaScriptSerializer();
return"(" + jss.Serialize(DateTime.Now) +")";
}

datestr will looking something like this:

"\/Date(1170660397825)\/"

deserializing this does not convert it to a date type.

Cheers

No comments:

Post a Comment