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