string content = string.Empty;
JavaScriptSerializer json = new JavaScriptSerializer();
foreach (var row in table)
{
person p = new person { name = row.Name, age = row.Age };
content = content + json.Serialize(p);
}
context.Response.Write(content);
public class person
{
public string name { get; set; }
public int age { get; set; }
}