W
webserverpete
I would like to have multiple <td> in a repeater control. The below
code does not work:
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="SqlDataSource1" DataMember="DefaultView">
<HeaderTemplate>
<table>
</HeaderTemplate>
<tr>
<ItemTemplate>
<td>
<%#DataBinder.Eval(Container.DataItem, "itemname")%>
$<%#FormatNumber(DataBinder.Eval(Container.DataItem, "itemprice"), 2)%>
<img src="images/<%#DataBinder.Eval(Container.DataItem,
"picfilename")%>">
<%#DataBinder.Eval(Container.DataItem, "itemdescription")%>
<%#DataBinder.Eval(Container.DataItem, "itemaddtime")%>
</td>
</ItemTemplate>
</tr>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
The problem with the above is the <tr>, if I take that out then that
page works. However this does not produce the disired results. I would
like to have more than five <td> in a <tr>, essentially wrapping the
<ItemTemplate> tag with <tr> tags and only repeating the <ItemTemplate>
five times.
Any help would be greatly appreciated,
Pete
code does not work:
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="SqlDataSource1" DataMember="DefaultView">
<HeaderTemplate>
<table>
</HeaderTemplate>
<tr>
<ItemTemplate>
<td>
<%#DataBinder.Eval(Container.DataItem, "itemname")%>
$<%#FormatNumber(DataBinder.Eval(Container.DataItem, "itemprice"), 2)%>
<img src="images/<%#DataBinder.Eval(Container.DataItem,
"picfilename")%>">
<%#DataBinder.Eval(Container.DataItem, "itemdescription")%>
<%#DataBinder.Eval(Container.DataItem, "itemaddtime")%>
</td>
</ItemTemplate>
</tr>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
The problem with the above is the <tr>, if I take that out then that
page works. However this does not produce the disired results. I would
like to have more than five <td> in a <tr>, essentially wrapping the
<ItemTemplate> tag with <tr> tags and only repeating the <ItemTemplate>
five times.
Any help would be greatly appreciated,
Pete