C # Repeater binds arrays, ArrayList and ArrayList object classes

Source: Internet
Author: User

An important function of the Data Control in ASP. NET is to bind data, and we usually use the most bound DataTable. However, in addition to DataTable, there are other data formats that can also be bound! This blog uses Repeater as an example to describe three ways to bind other data.


1. Repeater binds arrays and ArrayList

Front-end code


Background code


2. Bind the Repeater to the ArrayList object class

Front-end code


Background code

Running result



3. Summary

From the code above, we can compare whether it is to bind an array, ArrayList, or some other data, the difference only lies in the binding method of the front-end code. Therefore, other data controls such as the DataGridView are similar to the Repeater. This makes it easier to use these data controls in ASP. NET.




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.