October 2010
Intermediate to advanced
1920 pages
73h 55m
English
Every DataBound control included in ASP.NET 4 Framework supports templates with the sole exception of the TreeView control. The Repeater, DataList, ListView, and FormView controls all require you to use templates. If you don’t supply a template, these controls display nothing. The GridView, DetailsView, and Menu controls also support templates, but they do not require a template.
For example, when you use the Repeater control, you must supply an ItemTemplate. The Repeater control uses the ItemTemplate to format each of the records that it displays. Listing 8.9 contains a Repeater control that formats each of the records from the Movies database table (see Figure 8.8).
Figure 8.8. Using an ItemTemplate.
Listing 8.9. ShowItemTemplate.aspx ...