Displaying a Paged Grid of Data in ASP.NET MVC | CodeGuru

Displaying a Paged Grid of Data in ASP.NET MVC

This ASP.NET tutorial demonstrates how to display a paged grid of data in an ASP.NET MVC application and builds upon the work done in two earlier articles: Displaying a Grid of Data in ASP.NET MVC and Sorting a Grid of Data in ASP.NET MVC. Displaying a Grid of Data in ASP.NET MVC started with creating […]

Written By
CodeGuru Staff
CodeGuru Staff
Jan 5, 2011
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

This ASP.NET tutorial demonstrates how to display a paged grid of data in an ASP.NET MVC
application and builds upon the work done in two earlier articles: Displaying a Grid of Data in ASP.NET MVC and Sorting a Grid of Data in ASP.NET MVC. Displaying a Grid of Data in ASP.NET MVC started with creating a new
ASP.NET MVC application in Microsoft Visual Studio, then added the Northwind database to the project and showed how
to use Microsoft’s Linq-to-SQL tool to access data from the database. The article then looked at creating a
Controller and View for displaying a list of product information (the Model).

Sorting a Grid of Data in ASP.NET MVC enhanced the application by adding a view-specific Model (ProductGridModel) that provided the
View with the sorted collection of products to display along with sort-related information, such as the name of the database column
the products were sorted by and whether the products were sorted in ascending or descending order. The Sorting a Grid of Data in
ASP.NET MVC article also walked through creating a partial view to render the grid’s header row so that each column header was a link
that, when clicked, sorted the grid by that column.

In this article we enhance the view-specific Model (ProductGridModel) to include paging-related information to include the current
page being viewed, how many records to show per page, and how many total records are being paged through. Next, we create an action in
the Controller that efficiently retrieves the appropriate subset of records to display and then complete the exercise by building a
View that displays the subset of records and includes a paging interface that allows the user to step to the next or previous page, or
to jump to a particular page number, we create and use a partial view that displays a numeric paging interface.

Like with its predecessors, this article, Displaying a Paged Grid of Data in ASP.NET MVC offers step-by-step instructions and includes a complete, working demo available for download. Click the following link to view the entire article, Displaying a Paged Grid of Data in ASP.NET MVC.

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.