Difference between datalist, Repeater and Gridview

Source: Internet
Author: User

Advantages: griview is the most powerful. It provides many functions such as paging, editing, deletion, and selection. It is the most convenient to use and can be dragged directly to the page to create a new data source, after a few clicks, you can maintain the browsing, deletion, and modification of a table, and the page is displayed. (I haven't figured out how to click a few mouse clicks. If you know, please let me know .). In addition, it is not easy to customize templates and control them flexibly.


Disadvantage: it occupies a large amount of system resources. Its paging function retrieves the data of the entire table and returns it to the page on the gridview. Therefore, if the data volume is large, the speed is very slow. Low efficiency.

Datalist has better control styles .. No built-in pages .. Editing .. You have to hand it by yourself ..
 

There is also a repeater

Advantages: simple functions, high efficiency, easy and flexible control of generated HTML code, paging needs to be implemented by yourself, overall, if you are used to repeater will like it, suitable for foreground use.

Datalist is between them

When to use depends on your own program ..
 

Second person:

To put it simply: In the GridView, DataList is derived from WebControl and has the WebControl style attribute. DataList is parsed as a table, and each row is parsed as tr-td,

The Repeater is derived from Control and only repeats the content in the template. This is why the repeater does not provide ItemStyle, SelectItemTemplate, and style Control.

In terms of flexibility, the Repeater must be more flexible. It just loops the content and does not need to generate a series of spam code specified by. net, but at the same time, it also loses some of the features provided by. net. However, the html generated by compilation is simpler, so the efficiency is relatively high.

In terms of usage, it depends on which one you are better at using. Repeater is easier to set styles, and GridView is easier to add, delete, modify, and perform other operations.

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.