背景:在编码中,常会遇到根据Ajax的结果动态生成Table的情况,本篇进行简要的说明。这已经是我第4、5篇和Ajax有关的随笔了,互相之间有很多交叠的地方,可自行参考。

后台代码如下:

 1         public ActionResult Index()
 2         {
 3             
 4             return View();
 5         }
 6 
 7 
 8         public ActionResult GetStus()
 9         {
10             List<Stu> ListStu = new List<Stu>(){
11                 new Stu{Age=18,City="北京",Name="SharpL"},
12                 new Stu{Age=18,City="北京",Name="Lily"},
13                 new Stu{Age=18,City="南京",Name="Lucy"}
14             };
15             return Json(ListStu);
16         }
View Code

相关文章:

  • 2022-12-23
  • 2021-10-27
  • 2021-09-16
  • 2022-03-03
  • 2021-09-06
  • 2021-10-02
  • 2021-09-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案