public ActionResult About()
{
List<Stores> listStores = new List<Stores>();
listStores = this.GetResults("param");
return Json(listStores, "Stores", JsonRequestBehavior.AllowGet);
}
使用上面的代码的JSON数据,我能得到以下结果返回从MVC控制器
[{"id":"1","name":"Store1","cust_name":"custname1","telephone":"1233455555","email":"[email protected]","geo":{"latitude":"12.9876","longitude":"122.376237"}},
{"id":"2","name":"Store2","cust_name":"custname2","telephone":"1556454","email":"[email protected]","geo":{"latitude":"12.9876","longitude":"122.376237"}},
如何将我能得到以下结果格式?
{
"stores" : [
{"id":"1","name":"Store1","cust_name":"custname1","telephone":"1233455555","email":"[email protected]",
"geo":{"latitude":"12.9876","longitude":"122.376237"}},
{"id":"2","name":"Store2","cust_name":"custname2","telephone":"1556454","email":"[email protected]","geo":{"latitude":"12.9876","longitude":"122.376237"}} ]
}
我想要在数据的开头有stores
。
请在这方面帮助我。
像我这样做
其他选项.. 。要学会更快地输入:) – Tr1stan 2012-02-17 10:48:26