2012-04-19 50 views
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 。MVC3与MVCcontrib不渲染/生产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,它们都包含在内。

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

感谢

回答

1

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

+0

现在即时得到'的最好重载方法匹配“System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)”有一些无效参数'当我删除括号 – DarthVader 2012-04-19 21:35:38

+0

'@ Html.Raw(Html.Pager(Model.PagedViewModel.PagedList).First(“First”).Next(“Next”).Previous(“Previous”).Last(“Last”) .Format(“{0} - {1} di {2}”).ToString())'这工作。反正thansk。 – DarthVader 2012-04-19 21:44:39