在Articles.aspx中进行分页{ var viewData = mybaseRepository.FindAllArticles(); const int pageSize = 10; var paginatedArticle = new PaginatedList<Article>(viewData, page ?? 0 , pageSize); ViewData["Page"] = paginatedArticle.PageIndex; return View(paginatedArticle); } In Global.asax.cs routes.MapRoute( "Articles", "Articles/{page}", new { controller = "Home", action = "Aticles", page = (int?)null } );
&lt;%if(Model.HasPreviousPage){%&gt;
&lt;%= Html.RouteLink(“предыдущая&lt;&lt;&lt;”,
“公司章程”,
new {page =(Model.PageIndex - 1)})%&gt;
&lt;%}%&gt;
<% if (Model.HasNextPage) { %>
<%= Html.RouteLink(">>> следующая",
"Articles",
new {page = (Model.PageIndex + 1) })%>
<% } %>
<div>
答案 0 :(得分:0)
在URL中写“文章”,但在定义路径时写“文章”。那会是吗?