JSON format ASP.NET webforms -


i new json , when looking @ format of message, getting below.

[{"id":"000078","name":"-name not listed-","column1":"","column2":"","column3":"","city":"","lname":"unknown"},{"id":"00139800181","name":"sample name (office address, henderson)","column1":"office address","column2":"","column3":"","city":"henderson","lname":"clear"}] 

the following code generate above message

 dim serializer new system.web.script.serialization.javascriptserializer()  dim rows new list(of dictionary(of string, object))()  dim row dictionary(of string, object)  each dr datarow in datatable.rows      row = new dictionary(of string, object)()      each col datacolumn in datatable.columns         row.add(col.columnname, dr(col))      next         rows.add(row)      next   dim json string = serializer.serialize(rows)  return json 

i using asp.net 4.0 when have looked @ of forms, should receiving json format below.

{"d":[{"id":"000078","name":"-name not listed-","column1":"","column2":"","column3":"","city":"","lname":"unknown"},{"id":"00139800181","name":"sample name (office address, henderson)","column1":"office address","column2":"","column3":"","city":"henderson","lname":"clear"}]} 

not sure doing wrong here.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -