c# print object to json

JavaScript
 var json = new JavaScriptSerializer().Serialize(ObjectModel);
Source

Also in JavaScript: