Asp. NET three major controls:
1.GridView controls: Tabular view controls, which can be used to bind result sets or views, are easier and more flexible to use, and the most used controls in three controls
Usage---
this.gridview1.datasource=table;
This.gridview1.DataBind ();
2.Reapter CONTROLS: User-defined controls, no looks, customizable display, 5 templates available
Usage---
ItemTemplate: Formatting each item of data
AlternatingItemTemplate: Formatting alternating data items
SeparatorTemplate: Formatting separators
HeaderTemplate: Formatting the header
FooterTemplate: Formatting the footer
this.repeater1.datasource=table;
This.repeater1.DataBind ();
3.DataList CONTROLS: User-defined controls, no looks, also custom display content, in addition to binding result sets and views, you can also bind arrays and hash tables, and the most versatile controls in three controls. 2 more templates are expanded on top of the repeater control.
Usage---
ItemTemplate: Formatting each item of data
AlternatingItemTemplate: Formatting alternating data items
SeparatorTemplate: Formatting separators
HeaderTemplate: Formatting the header
FooterTemplate: Formatting the footer
EditItemTemplate: The style that is displayed when the row enters edit state
SelectedItemTemplate: The style that is displayed when the column is selected
this.datalist1.datasource=table;//form
or this.datalist1.datasource=array;//array
This.datalist1.DataBind ();
GridView Control Reapter control DataList control Differences and usage