hossein2801
New Member
I'm using JavaScriptSerializer to serialize objects. And I had trouble with it when serializing Exceptions. Or rather when deserializing serialized Exceptions, as it contains new line characters and backslashes for the file paths. (let's save controversies for another time).I have done a "js encoding" extension method to overcome that problem, very similar to the following one:http://stackoverflow.com/a/2680805/385926But I know that Asp.Net WebMethods serialize automatically to JSON, and the exceptions are serialized properly with no extra programming.So how does asp.net deal with those special char cases when serializing to JSON? Is there any class or method to deal with it? Aren't my extension method and that JsEncoding methods redundant for something that already exists in .Net?Thanks in advance.