MVC 4 PagedList - its makes my pages into a list

佐手、 提交于 2019-12-11 09:10:29

问题


I have got a page where I'm using the Nuget package PagedList.Mvc 4.3.0.0 (The latest version for MVC4). The problem is that when I'm listing the pages its makes my pages into a list of which look like

«
Showing items 1 through 5 of 17.
»

Instead of « Showing items 1 through 5 of 17. »

My view looks like

    <div class="pagedList" >
        @Html.PagedListPager(Model, page=> Url.Action("index", new { page }), PagedListRenderOptions.MinimalWithItemCountText)    
    </div>

Any suggestions on what could be wrong? The standard CSS is included as well.


回答1:


Make changes in your code like this....

    <div class="page_numbers page_numbers-sec">
         <div class="pagination">
             Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
                 of @Model.PageCount
             @Html.PagedListPager(Model, page => Url.Action("Index",new { page}))
          </div>
    </div>


来源:https://stackoverflow.com/questions/18648346/mvc-4-pagedlist-its-makes-my-pages-into-a-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!