GridView Control Reapter control DataList control Differences and usage

Source: Internet
Author: User

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

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.