Skip to main content

ASP.NET Bootstrap Pagination

aspBootPagination is a utility script for implementing professional bootstrap compatible simple and advance pagination links in your asp.net and vb.net application.


Features

List of core features of asp.net bootstrap pagination script.

  • Support both simple and complex pagination
  • Support jquery pagination.
  • Bootstrap compatible user interface and links.
  • and more.

Example Code

Example 1: Simple Pagination Implementation.

pagination1.TotalRecords = 50000;
pagination1.PageSize = 20;
pagination1.PageNumber = 1;
pagination1.Default_Url = "default.aspx";
pagination1.Pagination_Url = "default.aspx?p=[p]";
pagination1.paginationCss = "pagination-small";
pagination1.paginationStyle = 0; // 1: advance, 0: simple pagination
pagination1.showFirst = true;
pagination1.showLast = true;
pagination1.BindPagination();

Here is sample output

simple pagination screen 00
simple pagination screen 01
pagination1.TotalRecords = 50000;
pagination1.PageSize = 20;
pagination1.PageNumber = 1;
pagination1.Default_Url = "default.aspx";
pagination1.Pagination_Url = "default.aspx?p=[p]";
pagination1.paginationCss = "pagination-small";
pagination1.paginationStyle = 1; // 1: advance, 0: simple pagination
pagination1.showFirst = true;
pagination1.showLast = true;
pagination1.BindPagination();

Here is sample output

simple pagination screen 00
simple pagination screen 01

Add compatibility with Jquery

<script type="text/javascript">
$(function () {
    $('.pglinks').on({
        click: function (e) {
       	 	ProcessPagination(this);
        	return false;
        }
    }, '.pagination-css');
});
function ProcessPagination(obj) {
    var id = $(obj).attr('id');
    if (id != undefined) {
    	var pid = null;
    if (id.indexOf("pl_") != -1) {
    	pid = id.replace("pl_", "");
    }
    else if (id.indexOf("pn_") != -1) {
    	pid = id.replace("pn_", "");
    }
    else if (id.indexOf("pg_") != -1) {
   	 	pid = id.replace("pg_", "");
    }
    else if (id.indexOf("pp_") != -1) {
    	pid = id.replace("pp_", "");
    }
    else if (id.indexOf("p_") != -1) {
    	pid = id.replace("p_", "");
    }
    	alert(pid + " linke selected");
    }
}
</script>