Parsing WebGrid-Very useful ASP. NET Web Helper

Source: Internet
Author: User
WebGrid-One of the many useful ASP. NET Web Helper.

Write the HTML Yourself

In the previous chapters, you use the Razor code to display database data, and all HTML tags are handwritten:

DB instance

@{var db = Database.open ("Smallbakery"), var selectquerystring = "Select * from Product ORDER by Name"; 

Using the WebGrid Helper

The WebGrid helper provides a simpler way to display data.

WebGrid Helper:

Automatically create an HTML table to display the data

Support for different formatting options

Support for paging display of data

Support for sorting by clicking on a list title

WebGrid instances

@{var db = Database.open ("Smallbakery"), var selectquerystring = "Select * from Product ORDER by Id"; var data = db. Query (selectquerystring); var Grid = new WebGrid (data); }

"Recommended"

1. ASP. NET free Video Tutorials

2. Share the ASP. NET Learning Note (8) Webpages Helper

3. Share the ASP. NET Learning Note (7) Webpages Object

4. Detailed description of the ASP. mvc--View

5. ASP. NET's simple definition and introduction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.