public PartialViewResult HotNews()
{
var model = from i in ld.Tbl_news
where i.Type == "热点新闻" && i.Subject == "资讯"
orderby i.Time descending
select i;
return PartialView(model);
}
@model IEnumerable<MvcApp.Models.Tbl_news>
@foreach (var item in Model)
{
@item.Title
@item.Content
}
<div class="content">
@{ Html.RenderPartial("HotNews");} div>
直接RenderAction就可以。