Reputation: 57
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="PagedList.Mvc" %>
<%@ Import Namespace="PagedList" %>
<!DOCTYPE html>`enter code here`
<html>
<head runat="server">
<title>ViewPage1</title>
<link href="../../Public/css/PagedList.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div>
<table class="tableEmptyStyle">
<tr>
</tr>
</table>
<table>
<tr>
<th>
Code
</th>
<th>
Name
</th>
</tr>
<%
foreach (var item in ViewBag.OnePageDivisions)
{ %>
<tr>
<td>
<%: item.Code %>
</td>
<td>
<%: item.Name %>
</td>
</tr>
<% Html.PagedListPager((IPagedList)ViewBag.OnePageDivisions, page => Url.Action("Index", new { page = page }), PagedListRenderOptions.PageNumbersOnly); %>
<% } %>
</table>
Then from the controller I am getting the list and
ViewBag.OnePageDivisions = allList
I am able to get the list and display it,
the problem is the page numbers below are not showing.
The CSS, "PagedList.css" was taken from the package. Any help is appreciated
I am using MVC 3, PagedList 1.15.0.0 and PagedList.Mvc 3.18.0.0
Upvotes: 1
Views: 2235
Reputation: 83
Change
<% Html.PagedListPager((IPagedList)ViewBag.OnePageDivisions, page => Url.Action("Index", new { page = page }), PagedListRenderOptions.PageNumbersOnly); %>
To
<%: Html.PagedListPager((IPagedList)ViewBag.OnePageDivisions, page => Url.Action("Index", new { page = page }), PagedListRenderOptions.PageNumbersOnly) %>
Upvotes: 1