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