
116
|
Chapter 5: ASP.NET Server Controls
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Templates
Certain controls, most notably the Repeater data-bound control, can also use
templates to specify the appearance of the control output. In fact, the Repeater
control requires at least one template (the ItemTemplate) to display anything at
all.
The Repeater works by rendering anything contained in the HeaderTemplate (if
defined) and then rendering the contents of its data source based on the ItemTem-
plate, AlternatingItemTemplate (if defined), and SeparatorTemplate (if defined).
Once all rows of the data source have been rendered, the Repeater then renders
the contents of the FooterTemplate (if defined). Figure 5-13 shows the output of
ControlTemplates.aspx.
Additional Resources
The following site provides additional information on the topics discussed in this
chapter:
http://www.asp.net/forums/
The ASP.NET Forums has several forums dedicated specifically to server
control questions, including a forum for the DataGrid, DataList, and
Repeater controls, as well as one for the mobile controls.
HtmlInputText Control:
</td>
<td>
<input name="Text1" id="Text1" type="text"
style="font: 12pt arial;background-color:silver;color:red;"
/>
</td>
</tr>
<tr>
<td>
Label with Style:
</td>
<td>
<span id="Label2" class="Hello"
style="background-color:silver;"> ...