EDN Admin
Well-known member
This article demonstrates how to display a paged grid of data in an http://www.asp.net/mvc ASP.NET MVC application and builds upon the work done in two
earlier articles: http://www.4guysfromrolla.com/articles/121510-1.aspx Displaying a Grid of Data in ASP.NET MVC and
http://www.4guysfromrolla.com/articles/122210-1.aspx Sorting a Grid of Data in ASP.NET MVC . <i>Displaying a Grid of Data in ASP.NET MVC</i> started
with creating a new ASP.NET MVC application in Visual Studio, then added the Northwind database to the project and showed how to use Microsofts 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).
<i>Sorting a Grid of Data in ASP.NET MVC</i> enhanced the application by adding a view-specific Model (
) 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 <i>Sorting a Grid of Data in ASP.NET MVC</i> article also walked through creating a <i>partial view</i> to
render the grids 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 (
) 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 offers step-by-step instructions and includes a complete, working demo available for download at the end of the article.
Read on to learn more!
http://www.4guysfromrolla.com/articles/010511-1.aspx" class="readmore Read More >
View the full article
earlier articles: http://www.4guysfromrolla.com/articles/121510-1.aspx Displaying a Grid of Data in ASP.NET MVC and
http://www.4guysfromrolla.com/articles/122210-1.aspx Sorting a Grid of Data in ASP.NET MVC . <i>Displaying a Grid of Data in ASP.NET MVC</i> started
with creating a new ASP.NET MVC application in Visual Studio, then added the Northwind database to the project and showed how to use Microsofts 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).
<i>Sorting a Grid of Data in ASP.NET MVC</i> enhanced the application by adding a view-specific Model (
Code:
ProductGridModel
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 <i>Sorting a Grid of Data in ASP.NET MVC</i> article also walked through creating a <i>partial view</i> to
render the grids 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 (
Code:
ProductGridModel
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 offers step-by-step instructions and includes a complete, working demo available for download at the end of the article.
Read on to learn more!
http://www.4guysfromrolla.com/articles/010511-1.aspx" class="readmore Read More >
View the full article