1.分部页 _PartialPage.cshtml
@model List<string> <a>完美世界</a>
@foreach (var item in Model)
{
<li>@item</li>
}
2.HomeController.cs 和 index.html
public ActionResult Index()
{
var testObj = new List<string>()
{
"aaa", "bbb", "ccc"
};
return PartialView("_PartialPage", testObj);
}
<div>@Html.Partial("_PartialPage")</div>
3.demo
http://www.itnose.net/detail/6104431.html