Overview and differences of data binding controls in ASP. NET 2.0 (gridview, detailsview, formview, repeater, datalist)

Source: Internet
Author: User

Gridview Control
The gridview control usesTable FormatDisplays data and supports sorting, paging, reading data, and editing or deleting individual records.

Note:The gridview control is a successor control of the DataGrid control provided in earlier versions of ASP. NET. In addition to adding new features that utilize the data source control function, the gridview control also implements some improvements, for example, define the functions of multiple primary key fields, use the bound fields and templates to improve user interface customization, and use the new model to process or cancel events. For more information, see the gridview Web Server Control and compare the gridview and DataGrid web server controls.

Detailsview Control
Detailsview ControlPresent a table at a timeIt also provides the ability to read multiple records and insert, update, and delete records. The detailsview control is usually used in the master/details solution. In this solution, the selected records in the master control (such as the gridview Control) determine the records displayed by the detailsview control.

Formview Control
The formview control is similar to the detailsview control. It presents one record in the data source at a time and provides the ability to read multiple records and insert, update, and delete records. However, the difference between the formview control and the detailsview control is:The detailsview control uses table-based layout.In this layout, each field of the data record is displayed as a row in the control. The formview control does not specify the predefined layout for displaying records. In fact, you will create a template containing the control to display each field in the record. This template contains the format, controls, and binding expressions used to set the form layout.

Repeater control
The Repeater control uses the data source to returnA group of recordsRenderingRead-only list. Similar to the formview control, the repeater control does not specify a built-in layout. You can useTemplateCreate a repeater control layout.

datalist Control
the datalist control uses table format : displays data. With this control, you can use different la s to display data records. For example, sorts data records into columns or rows. You can configure the datalist control so that you can edit or delete records in the table. (The datalist control does not use the data modification function of the data source control. You must provide the Code .) The datalist control differs from the Repeater control in that the datalist control explicitly places items in the HTML table, while the Repeater control does not.

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.