YbRapidSolution.MVC项目首页分页没有起作用

@model YbRapidSolution.Mvc.Models.CmsPagerDataModel

<nav>

    <ul class="pager">

        <li class="@(Model.Data.IsFirstPage ? "disabled" : "")">

            @(!Model.Data.IsFirstPage ? Html.ActionLink("首  页",Model.ActionName,Model.ControllerName,

                new RouteValueDictionary(Model.RouteValues) { {"pageIndex", 0 },{"pageSize",Model.Data.PageSize}},null)

                : Html.Raw("<a>首  页</a>"))

        </li>

        <li class="@(Model.Data.HasPreviousPage ? "" : "disabled")">

            @(Model.Data.HasPreviousPage ? Html.ActionLink("上一页",Model.ActionName,Model.ControllerName,

                new RouteValueDictionary(Model.RouteValues) { {"pageIndex", Model.Data.PageIndex - 1 },{"pageSize",Model.Data.PageSize}},null)

                : Html.Raw("<a>上一页</a>"))

        </li>

        <li class="@(Model.Data.HasNextPage ? "" : "disabled")">

            @(Model.Data.HasNextPage ? Html.ActionLink("下一页",Model.ActionName,Model.ControllerName,

                new RouteValueDictionary(Model.RouteValues) { {"pageIndex", Model.Data.PageIndex + 1 },{"pageSize",Model.Data.PageSize}},null)

                : Html.Raw("<a>下一页</a>"))

        </li>

        <li class="@(Model.Data.IsLastPage ? "disabled" : "")">

            @(!Model.Data.IsLastPage ? Html.ActionLink("末  页",Model.ActionName,Model.ControllerName,

                new RouteValueDictionary(Model.RouteValues) { {"pageIndex", Model.Data.TotalPages - 1 },{"pageSize",Model.Data.PageSize}},null)

                : Html.Raw("<a>末  页</a>"))

        </li>

    </ul>

    <p class="text-center"><span class="badge">@(Model.Data.PageNumber)/@(Model.Data.TotalPages)</span>页 每页<span class="badge">@Model.Data.PageSize</span>条 共<span class="badge">@Model.Data.TotalCount</span></p>

</nav>

 

你可能感兴趣的:(mvc)