I found that my webmethod is returning data as
{ "d":
[
{"id":"1","itemtxt":"Masters"},
{"id":"2","itemtxt":"Transactions"},
{"id":"3","itemtxt":"Misch. Reports"}
]
}
If you notice, the array is named as "d". Why is that ? is there any rule for it?
For your information I am returning a list of objects (List<webitem>
)
public class webitem
{
public webitem(string kid, string kval)
{
this.id = kid;
this.itemtxt = kval;
}
public string id { get; set; }
public string itemtxt { get; set; }
}
What does this "d" mean ? will it allways be same for whatever data i send from my webmethod? or it is going to change depending on my data type/class type?
EDIT
Here is the webmethod
[WebMethod]
public List<webitem> GetSubModules(string key)
{
string s = " order by smid";
if (key != null)
s = " where moduleid=" + key + s;
return Utility.GetDDLVal("Select smid id,smname itemtxt from m_submodules "+s, null, null);
}
return ...
code – Provincialism