ASP.NET Guestbook - Changing the ASP:DATALIST tag (Page 7 of 8 )
Switch to the HTML view (Right click the datalist and select “View HTML source”) and enter the following code within the ASP:DATALIST tag
<HeaderTemplate>
<H1>Guestbook</H1>
<table>
</HeaderTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
<ItemTemplate>
<TR>
<TD>Name:</TD>
<TD><%#Container.DataItem("name") %></TD>
</TR>
<TR>
<TD>Email:</TD>
<TD><%# COntainer.DataItem("email") %></TD>
</TR>
<TR>
<TD>Rating:</TD>
<TD><%# Container.DataItem("rating")%>/5</TD>
</TR>
<TR>
<TD>Comments:</TD>
<TD><%# Container.DataItem("comments")%></TD>
</TR>
</ItemTemplate>
<AlternatingItemTemplate>
<TR bgcolor="InfoBackground">
<TD>Name:</TD>
<TD><%#Container.DataItem("name") %></TD>
</TR>
<TR bgcolor="InfoBackground">
<TD>Email:</TD>
<TD><%# COntainer.DataItem("email") %></TD>
</TR>
<TR bgcolor="InfoBackground">
<TD>Rating:</TD>
<TD><%# Container.DataItem("rating")%>/5</TD>
</TR>
<TR bgcolor="InfoBackground">
<TD>Comments:</TD>
<TD><%# Container.DataItem("comments")%></TD>
</TR>
</AlternatingItemTemplate>
<SeperatorTemplate>
<tr>
<td colspan=”2”><hr size=2color=”red”></td>
</tr>
Next: Explanation of the Tags >>
More ASP.NET Code Articles
More By R. Abhiram Vikrant