WebGrid use and understanding in ASP. NET MVC (translation)

Source: Internet
Author: User

1: Thinking

WebGrid is a table, a row of records, represents a model, so we only need to build a model in the Models folder, in the Controller generation model list, the list as a model into the view (or binding strongly typed view, this type is at least equal to this model list), and then through the gethtml (model,propetieslist). Very simple.

Some of the properties and methods of WebGrid are described below (this is especially true in setting the table row and column field property pagination sort)

Ajaxupdatecallback: callback function after completion of asynchronous operation

Ajaxupdatecontainerid: Update included elements

Cansort: Whether sorting is supported

ColumnNames: Column Name list, similar to database field list, usually we use list<string> type

Hasselection: Selection of the decision row

Isajaxenabled Returns A value that indicates whether the WebGrid instance can use Ajax calls to refresh the display

Similar to the number of rows, default selection, paging, how many rows per page, and so on, refer to MSDN.

Please refer to the original text, thank the author.

WebGrid use and understanding in ASP. NET MVC (translation)

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.