剃刀视图和mvccontrib网格分页的问题

Lor*_*nzo 3 asp.net-mvc mvccontrib mvccontrib-grid razor asp.net-mvc-3

我有以下部分视图代码

@model IEnumerable<PDoc.Web.Models.UserDocModel>
@using MvcContrib.UI.Grid;
@using MvcContrib.UI.Pager;
@using MvcContrib.Pagination;

<div id="docList">
@Html.Grid(Model).Columns( column => {
    column.For( u => u.Description ).Named( "Description" );
    column.For( u => u.FileName ).Named( "File name" );
    column.For( u => u.FileSize ).Named( "Size" );
    column.For( u => u.UploadDate.ToShortDateString() ).Named( "Upload Date" );
    } ).Attributes( @class => "table-list" ).Empty( "No documents uploaded" )

    <div style="position:absolute; bottom: 3px; width: 95%;">
        @Html.Pager( (IPagination)Model )..First( "First" ).Next( "Next" ).Previous( "Previous" ).Last( "Last" ).Format( "{0}-{1} di {2}" )
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

这会为编码的html呈现分页,如下面使用Chrome Developer Tool复制的代码段所示

<div id="myDocs">
  <div id="docList">
     <table class="table-list">...</table>
     <div style="position:absolute; bottom: 3px; width: 95%;">
        &lt;div class='pagination'&gt;&lt;span class='paginationLeft'&gt;1-1 di 1&lt;/span&gt;&lt;/div&gt;
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

为什么?

使用Chrome DT,我可以看到围绕编码标记的两个双引号.这只是一种表现出编码的方式吗?

替代文字

mdm*_*m20 6

我认为它正在进行双重编码.如果你将Html.Pager的东西放在Html.Raw()方法中,它应该可以工作.

  • @ Html.Raw(Html.Pager(型号).首先( "第一").接下来( "下一个").以往( "上一页").去年( "尾").Format("{0} - {1} di {2}").ToString())将是参考语法. (2认同)