我有这个代码..
Models.Person p = new testmvc.Models.Person { Firstname = "yongeks", Lastname = "ucab" }; Models.Person p2 = new testmvc.Models.Person { Firstname = "lyn", Lastname = "torreon" }; string q = JavaScriptConvert.SerializeObject(new String[] { JavaScriptConvert.SerializeObject(p), JavaScriptConvert.SerializeObject(p2) }); Console.WriteLine(q); return q;
我需要将此代码解析为jquery ..使用json请求..可以有人帮助我..
只需使用控制器的Json方法序列化类型并返回JsonResult:
Models.Person p2 = new testmvc.Models.Person { Firstname = "lyn", Lastname = "torreon" }; return Json( p2 );