using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Newtonsoft.Json; namespace MarionetteExamples { public partial class loading_initial_data : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { var model = new { Id = 1, Text = "Hi There" }; var collection = new[] { new { Id=1, Text="Hi" }, new { Id=2, Text="There" } }; jsonText.Text = JsonConvert.SerializeObject(model); jsonCollectionText.Text = JsonConvert.SerializeObject(collection); } } }