Eval(Container.DataItem,"Title") %>
<%# DataBinder.Eval(Container.DataItem,"Author") %> | <%# DataBinder.Eval(Container.DataItem,"ISBN") %> | <%# DataBinder.Eval(Container.DataItem,"DatePublished") %> |
DataFile="~/App_Data/ApressBooks.mdb"
SelectCommand="SELECT [Title], [Author], [ISBN], [DatePublished]
FROM [Books]">Listing 1-10. The ListControls Web Form Code-Behind Class File
using System;
using System.Web.UI.WebControls;
namespace ControlsBook2Web.Ch01
{
public partial class ListControls : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
The data source in the list controls example is an AccessDataSource named ApressBooksds
that contains rows from a sample database of Apress books. The Repeater control is bound
directly to the ApressBooksds control.
The Repeater control is templated to produce an HTML table with HTML rows representing
each data row in the ApressBooksds data-source control. The HeaderTemplate and FooterTemplate
give us the table opening and closing tags, and the ItemTemplate and AlternatingItemTemplate
give us the structure for each row in the table.
Pages:
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80