JSON output data is wrapped in XML tag
Hi , I am using a webservice to returm JSON Data:[System.Web.Services.WebMethod()]
[ScriptMethod(ResponseFormat = ResponseFormat.Json,UseHttpGet =true )]
public string GetProductListJson()
{
List<ProductListMobile> list = new List<ProductListMobile>();
list.Add(new ProductListMobile(1, "Task1", "Appnt Scheduled", 300));
// Context.Request.Headers.Add("Content-Type", "application/json");
// Context.Response.Headers.Add("Content-Type", "application/json");
string s = new JavaScriptSerializer().Serialize(list);
return s;
}
following is the output in browser , when i call the service.
<string xmlns="http://tempuri.org/">
[{ProductID: 1, Task: 'sf', TaskDescription:'sdfa'}]
</string>
I don't want output to be wrapped in XML tags.please let me know the way.......
Thanks!
Anjali Bansal