using System.Web;
using Zengenti.Data;
using Zengenti.Contensis.Delivery;
const int PageSize = 10;
// Create a client instance
var client = ContensisClient.Create();
// Get the pageIndex passed on the query string
var selectedPageIndex = int.Parse(Request.QueryString["pageIndex"]);
// Get the first 10 movie entries
var moviesList = client.Entries.List("movies", new PageOptions(selectedPageIndex, PageSize));
// Render a pager, applying a 'selected' class for the current page
<ul class="pager">
@for(var index = 0; index < movieList.PageCount; index++)
{
var selectedClass = (selectedPageIndex == index ? "selected" : null);
// The class will only be applied if selectedClass is not null
<li class="@selectedClass"><a href="#">@(index + 1)</a></li>
}
</ul>