asp.net DataList and Repeater usage Difference _ practical skill

Source: Internet
Author: User

Performance aspects

Repeater is better than DataList, if not very large amount of data, this difference is not reflected.

Ease of Use

Repeater and DataList background data binding is very simple, datasource= ... DataBind () It's OK.

But the DataList in the layout of the operation more convenient, such as it provides selectitemtemplate,eidtitemtemplate, but repeater did not, so for a selected color or background picture changes, The best choice is DataList. If you use repeater, you need JavaScript to control it.

HTML parsing

DataList itself is parsed into a table, each of which is resolved to TR-TD

Repeater is just repeating the content in the template, which is probably why Repeater didn't provide the itemstyle,selectitemtemplate for these templates and style controls.


Of course, other aspects of the difference is still some, specific online there are many, above just I do in the process of doing the project some feeling, which I use Repeater to implement my menu, with DataList to achieve a list of selected discoloration.

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.