Possible Duplicate:
How to set formatting with JavaScriptSerializer when JSON serializing?
I'm using using System.Web.Script.Serialization to serialize some json. However, by default it makes ugly text without indentation.
JavaScriptSerializer serializer = new JavaScriptSerializer();
var json = serializer.Deserialize<Dictionary<string,dynamic>>(s);
// do something else to the json...
//serialize the result
string serialized = serializer.Serialize(json);
// ugly text
I'm looking at the second overload and it takes a StringBuilder. I've not used these much. Can I use that to format pretty JSON? How would I do that in this context?