Is there a way in .NET that I can test if a JSON string I am about to send back to the client is valid? I am using an ASHX handler that accepts a bunch of form variables and returns a chunk of JSON that gets interpreted by the client. One of the parameters in the JSON contains a block of html that despite encoding sometimes gets corrupted with characters that cause a JSON error on the client. I'd like to catch this before it goes and email the sys admin with the details.
Additional info:
Target Framework 4.0
.ajax JQuery method used to send and read the response.