RE: A question about Repeater control
- From: stcheng@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
- Date: Wed, 01 Feb 2006 03:52:41 GMT
Hi Vincent,
Welcome to the ASPNET newsgroup.
>From your description, you're using the ASP.NET repeater control to display
list of hyperlinks on page. Also, the links' data is retrieved from
database table and one link per data table row. Currently you're wondering
how to display them through html table element and each link item in a
table cell, correct?
If this is the case, I think you can consider use the template in repeater
control to declare the html table content. Since you're wantting to display
the link items in html table cell(not row), we need to bread each <td>
content into ItemTemplate. e.g:
=================
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate><table><tr></HeaderTemplate>
<ItemTemplate>
<td>
<a href="<%# xxx %>" ......><%# xxx %></a>
</td>
</ItemTemplate>
<FooterTemplate></tr></table></FooterTemplate>
</asp:Repeater>
===================
This will help display each data item in an html table
cell(<td>...</td>).And the links are displayed horizontally.
If we want to display them vertically, just change the template to divide
each Item into html row (<tr>...). e.g:
=================
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate><table></HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<a href="<%# xxx %>" ......><%# xxx %></a>
</td>
</tr>
</ItemTemplate>
<FooterTemplate></table></FooterTemplate>
</asp:Repeater>
===================
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
.
- Follow-Ups:
- Re: A question about Repeater control
- From: Vincent Ye
- Re: A question about Repeater control
- Prev by Date: Re: Gridview not updating database row
- Next by Date: Re: A question about Repeater control
- Previous by thread: Re: Gridview not updating database row
- Next by thread: Re: A question about Repeater control
- Index(es):
Relevant Pages
|
Loading