Tech Tutorials Database
GeekArticles Database SQL Server
 

Sorting a Grid of Data in ASP.NET MVC

 
Author: 4guysfromrolla.com
Category: SQL Server
Comments (0)

<p> Last article, <a a Grid of Data in ASP.NET MVC</a>, showed, step-by-step, how to display a grid of data in an <a MVC</a> application. Last article 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 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). </p><p> This article builds on the demo application created in <i>Displaying a Grid of Data in ASP.NET MVC</i>, enhancing the grid to include bi-directional sorting. If you come from an ASP.NET WebForms background, you know that the GridView control makes implementing sorting as easy as ticking a checkbox. Unfortunately, implementing sorting in ASP.NET MVC involves a bit more work than simply checking a checkbox, but the quantity of work significantly greater and with ASP.NET MVC we have more control over the grid and sorting layout and markup, as well as the mechanism through which sorting is implemented. With the GridView control, sorting is handled through form postbacks with the sorting parameters - what column to sort by and whether to sort in ascending or descending order - being submitted as hidden form fields. In this article use querystring parameters to indicate the sorting parameters, which means a particular sort order can be indexed by search engines, bookmarked, emailed to a colleague, and so on - things that are not possible with the built-in sorting capabilities. </p><p> Like with its predecessor, 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! <br /><a More &gt;</a></p>

Read More...




Sponsored Links




Read Next: Filtering a Grid of Data in ASP.NET MVC



 

 

Comments



Post Your Comment:

Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe