开发者

Problem with razor view and mvccontrib grid pagination

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>

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>

Why?

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?

Problem with razor view and mvccontrib grid pagination


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜