Pagination Module - ASP.NET jClassified

ASP.NET jClassified have included easy to use, portable pagination script to paginate listing contents.


ASP.NET jClassified include professionally written, easy to customize, portal pagination module that can be used with any type of listings.

There are two parts of pagination module.

  • Pagination Component (User Control)
  • Pagination Logic

Pagination Component

Tis is a portal component that can be used with any type of listing to render pagination based on data passed to it.

Sample use of pagination component.

  if (TotalRecords > Model.QueryOptions.pagesize)
      var _paginationEntity = new Jugnoon.models.PaginationViewModel()
          pagenumber = Model.QueryOptions.pagenumber,
          TotalRecords = TotalRecords,
          PageSize = Model.QueryOptions.pagesize,
          Default_Url = Model.DefaultUrl,
          Pagination_Url = Model.PaginationUrl
      @Html.Partial("~/Views/partials/list/_Pagination.cshtml", _paginationEntity)

Pagination component require PaginationViewModel model entity to pass data. Important attributes include

  • pagenumber: represent current page of listing, by default = 1
  • TotalRecords: represent total number of records this listing may have e.g 3000 records.
  • PageSize: represent current listing page size.
  • Default_Url: set default url for pagination. To be used on first page link
  • Pagination_url: set pagination url e.g /page/[p] where [p] to be replace with dynamically set page number.

Pagination Logic

This is part of backend pagination component that actually generate array of pagination links. There are two logics currently supported

  • Simple Logic: this will generae normal sequencial pagination links
  • Advance Logic: this will generae links in a way that will cover almost all paginations whether there are thousands of pagination links in few steps. This will allow user & search engines to access almost every page in few steps

Settings Pagination

You can set maximum number of links to be displayed via Control Panel->Settings->Configurations->Generate Configurations section.

e.g if you set maximum links to 100, pagination script will not allow to render more links than 100 even if it include 50,000 links