Tech Tutorials Database
GeekArticles Database SQL Server
 

Use MvcContrib Grid to Display a Grid of Data in ASP.NET MVC

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

<p> The past six articles in this series have looked at how to display a grid of data in an ASP.NET MVC application and how to implement features like sorting, paging, and filtering. In each of these past six tutorials we were responsible for generating the rendered markup for the grid. Our Views included the <code>&lt;table&gt;</code> tags, the <code>&lt;th&gt;</code> elements for the header row, and a <code>foreach</code> loop that emitted a series of <code>&lt;td&gt;</code> elements for each row to display in the grid. While this approach certainly works, it does lead to a bit of repetition and inflates the size of our Views. </p><p> The ASP.NET MVC framework includes an <a class</a> that adds support for rendering HTML elements in a View. An instance of this class is available through the <code>Html</code> object, and is often used in a View to create action links (<code>Html.ActionLink</code>), textboxes (<code>Html.TextBoxFor</code>), and other HTML content. Such content could certainly be created by writing the markup by hand in the View; however, the <code>HtmlHelper</code> makes things easier by offering methods that emit common markup patterns. You can even <a your own custom HTML Helpers</a> by adding <a methods</a> to the <code>HtmlHelper</code> class. </p><p><a is a popular, open source project that adds various functionality to the ASP.NET MVC framework. This includes a very versatile <a HTML Helper</a> that provides a strongly-typed way to construct a grid in your Views. Using Grid HTML Helper you can ditch the <code>&lt;table&gt;</code>, <code>&lt;tr&gt;</code>, and <code>&lt;td&gt;</code> markup, and instead use syntax like <code>Html.Grid(...)</code>. This article looks at using the MvcContrib Grid to display a grid of data in an ASP.NET MVC application. A future installment will show how to configure the MvcContrib Grid to support both sorting and paging. Read on to learn more! <br /><a More &gt;</a></p>

Read More...




Sponsored Links




Read Next: Article :: Communication Tips for Technology Professionals



 

 

Comments



Post Your Comment:

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