Simple pagination in mvc

By | December 20, 2015

Pagination is a common need when serving large datasets in any program. In a ASP.Net MVC web app, rendering a large dataset, it makes sense to paginate dataset for responsiveness  and serve that dataset records in terms of pages and a predetermined fixed page size.

Following code snippet tries to achieve similar function of computing pagination scheme when rendering cities dataset using a fixed page size of 10 records