问题的Razor视图和mvccontrib分页格 [英] Problem with razor view and mvccontrib grid pagination

查看:192
本文介绍了问题的Razor视图和mvccontrib分页格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下的局部视图code

I have the following partial view code

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

这使得连接codeD的HTML分页如下面的代码片段,其中Chrome开发者工具

This renders encoded html for the pagination as in the following snippet copied with 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>

为什么?

另外随着Chrome的DT我可以看到周围的EN codeD标记两个双引号。是只有一种方式来展示一些东西THT的EN codeD?

Also with Chrome DT I can see two double quote surrounding the encoded markup. Is that only a way to show something tht's encoded?

推荐答案

我觉得它越来越双带codeD。如果你把Html.Pager里面的东西的Html.Raw()方法,它应该工作。

I think it's getting double encoded. If you put the Html.Pager stuff inside of an Html.Raw() method, it should work.

这篇关于问题的Razor视图和mvccontrib分页格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆