I have a problem with Json formating returned from .ASMX
I need to return something like this
[{ name : "TEST1", data : [100]},
{ name : "TEST2", data : [200]}]
so here’s my sample
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
public List<jsonGraphSeries> Graph(string ID)
{
List<GenList>objGenList = new List<GenList>();
GenList objlist;
objlist = new GenList();
objList.name = "TEST";
objList.data[0] = 100;
objGenList.add(objList);
}
public class GenList
{
public string name;
public double[] data;
}
and nothing happens… can someone help me with this?
silly me… in order for the json to recognize it as an array field…
instead of doing this…
I should’ve done it like this…
the output would be