0
@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。

我究竟做错了什么?有任何想法吗?

谢谢

4

1 回答 1

1

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

于 2012-04-19T21:31:25.983 回答