ASP Web Form Quick Start for. NET (5)

Source: Internet
Author: User

ASP Web Form Quick Start for. NET


List, data, and data binding

ASP. NET has a set of built-in data binding and list controls, which can be used to design a Custom User interface for accessing the database. The following example describes how to use the <asp: datagrid runat = server> Control to bind the book information obtained from the SQL database query:


Intro7.5.aspx
Click execute to view the source code

<Asp: datagrid runat = server> the DataGrid Control provides an easy way to quickly display data results with the help of the traditional grid user interface. ASP. NET developers can also choose to use the <asp: DataList runat = server> DataList control and the custom "ItemTemplate" template to customize data information:


Intro8.aspx
Click execute to view the source code

As shown in the preceding example, the <asp: datalist runat = server> control allows the end user to precisely control the structure and layout of each project in the list (by setting the ItemTemplate template attribute ). At the same time, this control can automatically handle the situation of two columns with automatic line breaks by using the Repeatcolumn attribute of datalist to control the number of columns.
See the following example of using the <asp: datalist runat = server> control:


Intro9.aspx
Click execute to view the source code


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.