using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; namespace TypeScriptExamples.AjaxServerSide { public partial class ModelUpdateCar : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { int primaryKey; string name; string description; Response.ContentType = "text/plain"; Response.ContentEncoding = Encoding.UTF8; if (int.TryParse(Request.Form["id"], out primaryKey) == false) { // For this example we just return an ID // of zero. primaryKey = 0; } name = Request.Form["name"]; description = Request.Form["description"]; Response.Write(OutputValues(primaryKey, name, description)); } private string OutputValues(int id, string name, string description) { StringBuilder sb = new StringBuilder(); sb.AppendFormat("id={0}", id); sb.Append("&"); sb.AppendFormat("name={0}", name); sb.Append("&"); sb.AppendFormat("description={0}", description); return sb.ToString(); } } }