Ane'x Bm Ane'x Bm - 18 days ago 4x
JSON Question

jsonArray not showing (web service)

Methode in web Service

Methode :

[ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
public void GetList()
JavaScriptSerializer ser = new JavaScriptSerializer();

Test[] test=new Test[3];
test[0] = new Test("1", "anex");
test[1] = new Test("2", "Ahmed");
test[2] = new Test("3", "Karim");

var json = new
list=test ,


Result :

List not showing !!


The Test class does contain private fields only. Therefore the JavaScriptSerializer will ignore them. Declare them as public an they will show up in the produced JSON.