MVC3 与 MVCcontrib 不渲染/生成 html

本文关键字:生成 html MVCcontrib MVC3 | 更新日期: 2023-09-27 18:31:47

@model SocialReader.BackOffice.Models.NewsAndCategories
@using MvcContrib.UI.Grid;
@using MvcContrib.UI.Pager;
@using MvcContrib.Pagination;
@using System.Linq;
@using SocialReader.BackOffice.Common;
@{
    ViewBag.Title = "News";
}
<h2>@ViewBag.Message</h2>
<p>
    @Html.ActionLink("Create News", "Create", "News")
</p>
@{Html.RenderPartial("Pager", Model.PagedViewModel.PagedList);}
@Html.Grid(Model.PagedViewModel.PagedList).Columns(column =>
{
    column.For(x => Html.ActionQueryLink(x.Title, "View", new { id = x.Id })).Named("Title").InsertAt(0);
    column.For(x => x.Category.Name).Named("Category").InsertAt(1);
    column.For(x => x.DateUpdated).Named("Date Updated").InsertAt(2);
    column.For(x => x.Published).Named("Is Published").InsertAt(3);
    column.For(x => x.ViewCount).Named("View Count").InsertAt(4);
    column.For(x => x.UserCreated).Named("Authoer").InsertAt(5);
}).Sort(Model.PagedViewModel.GridSortOptions).Attributes(@class => "grid-style")

有这段代码,我正在尝试对新闻进行分页,但是您单击下一个上一个等的分页没有呈现我看到的纯 HTML,而不是呈现的 HTML。

<div class='pagination'><span class='paginationLeft'>Showing 1 - 10 of 41 </span><span class='paginationRight'>First | Previous | <a href="/News/Index?page=2">Next</a> | <a href="/News/Index?page=5">Last</a></span></div>

这是我在页面上看到的,而不是呈现的。我已经检查了CSS和JS,它们都包含在内。

我做错了什么?有什么想法吗?

谢谢

MVC3 与 MVCcontrib 不渲染/生成 html

使用@Html.RenderPartial而不是@{Html.RenderPartial}