@{ // If this is the initial page request, get the data and add to a form. if(!IsPost) { var db = Database.Open("bakery"); var products = db.Query("SELECT * FROM PRODUCTS").ToList(); // JSON.Encode converts data to a JSON-encoded string, which we can // send to the browser in an HTML form or JavaScript. var JsonString = Json.Encode(products); } else { // If the page is a postback, display the user's updated data in a table.

JSON-decoded Data Posted by a User

@foreach(var p in Json.Decode(Request["jsonDataField"])) { }
Name Description Price
@p.Name @p.Description @p.Price
} }