I\'ve got a dictionary
as part of my view model. What I\'m trying to do is cycle this object and output it as a json object. My reason for
Considering you are on mvc 3 you'll have access to JavaScriptSerializer. You should be able to do the following:
JavaScriptSerializer serializer = new JavaScriptSerializer();
string json = serializer.Serialize((object)yourDictionary);
This will serialize your dictionary to json. You may want to do this in the controller before sending the ViewData to the view to render.