MVC5布局页的部分动态数据,用了@Html.Action(“”,””)来动态显示数据 |
|
100分 |
|
100分 |
routes.MapRoute(“A”,
“Home/a.html”, new { controller = “Home”, action = “a” } ); routes.MapRoute(“B”, “Home/Home{id}.html”, // 带有参数的 URL new { controller = “Home”, action = “Index”, Id = 0 } ); routes.MapRoute(“topic”, “Home/Topic{Id}.html”, new { controller = “Home”, action = “Topic”, Id = 0 } ); 在HomeController public ActionResult Topic() { int i = 0; var sort = this.RouteData.Values[“id”]; } 动态获取数据可使用 $.post(“/Home/GetList/”, { pageIndex: 1, pageSize: pageSize, sort: $(“#sort”).val() }, function (data) { var str = “”; $.each(data, function (index, item) { str += item.Title; }); $(“#result”).html(str); |