Serializing dictionaries with JavaScriptSerializer
Apparently, IDictionary<string,object> is serialized as an array of KeyValuePair objects (e.g., [{Key:"foo", Value:"bar"}, ...] ). Is is possible to serialize it as an object instead (e.g., {foo:"bar"} )? Although I agree that JavaScriptSerializer is a crap and Json.Net is a better option, there is a way in which you can make JavaScriptSerializer serialize the way you want to. You will have to register a converter and override the Serialize method using something like this: public class KeyValuePairJsonConverter : JavaScriptConverter { public override object Deserialize(IDictionary<string,