Question

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?

alt text

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top