razor 视图和 mvccontrib 网格分页问题
我有以下部分视图代码,
@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>
这会呈现用于分页的编码 html,如使用 Chrome 开发人员工具复制的以下代码片段所示,
<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>
为什么?
另外,使用 Chrome DT,我可以看到编码标记周围有两个双引号。这只是显示编码内容的一种方式吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为它被双重编码了。如果将 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.