Overview of ASP. NET data binding web server controls

Source: Internet
Author: User
Gridview Control

Gridview
Controls display data in the form of tables, and provides the ability to sort columns, read data, and edit or delete a single record.

:

The gridview control is
DataGrid provided in earlier versions of ASP. NET
Controls. In addition to adding new features that utilize the data source control function, the gridview
Controls also implement some improvements, such as defining multiple primary key fields, using bound fields and templates to improve user interface customization, and using new models to process or cancel events.

For more information, see
Control and Comparison
The gridview and DataGrid web server controls.

 

The data source value is displayed in the table. Each column represents a field, and each row represents a record. Use the gridview control to select and edit
Sort these items and sort them.
The gridview control is used to display the value of the data source in the table. Each column represents a field, and each line represents a record. Gridview Control Support
The following functions are supported:

Bind to a data source control, such as sqldatasource.
Built-in sorting function.
Built-in update and delete functions.
Built-in paging function.
Built-in row selection function.
Access the gridview object model programmatically to dynamically set attributes and process events.
Multiple key fields.
Multiple data fields used for hyperlink columns.
You can customize the appearance through themes and styles.
To learn about other data binding controls provided by ASP. NET, see ASP. NET data binding Web Server Control overview.

Detailsview Control

Detailsview
Controls display records in the form of a table at a time, and provides the ability to read multiple records and insert, update, and delete records. Detailsview
Controls are usually used in the Master/Slave solution. In this solution
The selected record determines the detailsview.
Control display records.

For more information, see detailsview Web Server
Control.

 

The value of a single record from the data source is displayed in the table. Each Data row represents a field of the record. The detailsview control allows
You can edit, delete, and insert records.
The detailsview control is used to display a single record from the data source in the Table. each field of the record is displayed in a row of the table. It can
Used in combination with the gridview control for the Master/Slave solution. The detailsview control supports the following functions:
Bind to a data source control, such as sqldatasource.

Built-in insert function.
Built-in update and delete functions.
Built-in paging function.
Access the detailsview object model programmatically to dynamically set attributes and process events.
You can customize the appearance through themes and styles.

Formview Control

The formview control and
Detailsview
Similar to the control, it presents a record in the data source at a time and provides the ability to read multiple records and insert, update, and delete records. However, the formview control and
Detailsview
The difference between controls is: detailsview
The control uses a table-based layout. In this layout, each field of the data record is displayed as a row in the control. While formview
The control does not specify the predefined layout used to display 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.

For more information, see formview Web Server
Control.

 

Use a user-defined template to display the values of a single record in the data source. You can use the formview control to edit, delete, and insert records.

The formview control is used to display a single record in the data source. This control is similar to the detailsview control, but it only displays the User-Defined
Template rather than line Fields. Creating your own template allows you to more flexibly control the data display mode. The formview control supports the following

Function:

Bind to a data source control, such as sqldatasource and objectdatasource.
Built-in insert function.
Built-in update and delete functions.
Built-in paging function.
Access the formview object model programmatically to dynamically set attributes and process events.
You can use custom templates, themes, and styles to customize the appearance.

Repeater control

Repeater
The control displays the read-only list using a set of records returned by the data source. And formview
Similar to controls, Repeater
The widget does not specify the built-in layout. You can use the template to create a repeater
Control layout.

For more information, see repeater Web Server
Control.

 

A data binding list control allows you to customize the layout by repeatedly specifying each template displayed in the list.
The Repeater control is a list of basic template data bindings. It does not have a built-in layout or style, so it must be displayed in the template of the control
Declare all la S, format settings, and style tags.

The Repeater control is the only web control that allows tags to be split between templates. To create a table using a template, go to headertemplate
Including the table start mark (<Table>), including a single table row mark (<tr>) in itemtemplate, and in footertemplate
Including the end mark of the table (</table> ).

The Repeater control does not have built-in selection and editing support. You can use the itemcommand event to process the control triggered by the template.
Control event.

Datalist Control

Datalist
Controls display data in the form of tables. With this control, you can use different la s to display data records, such as arranging data records into columns or rows. You can
Allows you to edit or delete records in a table. (Datalist
The control does not use the data modification function of the data source control. You must provide this code by yourself .) The datalist control and
Repeater
Controls differ in that the datalist control explicitly places items
HTML table, while Repeater
Control.

For more information, see datalist Web Server
Control.

 

Displays the data binding list control for items using the template.
Use the datalist control to display the data binding list defined by the template. The datalist control supports selection and editing.

Listview Control

Listview
Controls can display data from the data source in the format defined by the template. This template contains the formats, controls, and binding expressions used to set the data layout. Listview
Controls are useful for data in the repeat structure. They are similar to datalist and
Repeater control. However
Datalist and
Repeater
Different controls are: listview
Controls Support implicit editing, insertion, and deletion, as well as sorting and paging.

For more information, see listview Web
Server Control overview.

 

Use a user-defined template to display the value of the data source. The listview control allows you to select, sort, delete, edit, and insert records.
The listview control is used to display the value of the data source. Similar to the gridview control, the difference is that it uses a user-defined template instead
To display data. Creating your own template allows you to more flexibly control the data display mode.

The listview control supports the following functions:
Supports binding to data source controls, such as sqldatasource, linqdatasource, and objectdatasource.
You can use custom templates and styles to customize the appearance.
Built-in sorting function.
Built-in update and delete functions.
Built-in insert function.
You can use the datapager Control for paging.
Built-in item selection function.
Access the listview object model programmatically to dynamically set attributes and process events.
Multiple key fields.

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.