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%;">
<div class='pagination'><span class='paginationLeft'>1-1 di 1</span></div>
</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?
I think it's getting double encoded. If you put the Html.Pager stuff inside of an Html.Raw() method, it should work.
精彩评论