string query = context.Request.QueryString["tag"];
System.Web.Script.Serialization.JavaScriptSerializer JsonSerializer =
new System.Web.Script.Serialization.JavaScriptSerializer();
context.Response.ContentType = "application/json";
context.Response.Write(JsonSerializer.Serialize(Category.GetAll()));
This returns successfully but how can I name the returned JSON array?
Like by default ASP.NET names json arrays returned with “d”. How can I create the same functionality when doing my own returns?
If you want something named “d”, maybe:
And serialize that: