Iam tried to display json array,but instead of json i got xml.How can i display json array
public HttpResponseMessage jsonvalues()
{
{
var retList = new List<string>();
RootObject ro = new RootObject();
DataTable dtaltheat = GetAlltheatredet();
foreach (DataRow drow in dtaltheat.Rows)
{
string theatnme = drow["TheatreName"].ToString();
ro.name = theatnme;
JavaScriptSerializer js = new JavaScriptSerializer();
var jsonString = JsonConvert.SerializeObject(ro);
if (jsonString != null)
{
retList.Add(jsonString);
}
// JavaScriptSerializer ser = new JavaScriptSerializer();
}
// return retList;
return Request.CreateResponse(HttpStatusCode.OK, retList);
}
}
iam using to display datatable contents and its woriking fine,but my only problem is that to unable to display json array...