By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,678 Members | 2,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,678 IT Pros & Developers. It's quick & easy.

data repeater - table layout vs schema

P: n/a
Hi all,

Ok - I need to plonk a repeater in my form which is using a template (table
and series of web user controls)...as a result I have something like this
(short version)
<table>
<tr>
<td>
<!-- main app content goes here-->
</td>
</tr>
</table>
Right, so that's where I need the repeater to go - the repeater will be
producing a series of hyperlinks based on the name and id pulled from a
database and then me adding the full URL etc to it before it goes to the
page.

<asp:Repeater id="SubjectList" runat="server">
<HeaderTemplate>
<table cellspacing="0" cellpadding="0" border="0">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# DataBinder.Eval(Container.DataItem, "SubjectLink")
%>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

Now - I am getting messages appearing (which dont appear to prevent the app
from running) - which stat that I cant have a repeater within a <td> and
that I havent closed the <table> tag (within the header template etc) - and
so on.

I appreciated I could either

a) Close all html tags infront of the repeater
b) Remove the schema line from the html (which was added by default)
c) Make the header, items and footer all tables within their own right etc

but none of these seem like a good idea....my other thought was to simply
through a label up there, iterate through a recordset in the code behind
page, create a string add <br>'s etc to it and then dump it to the page...

Has anyone got any ideas/advice - I've not used repeaters or datagrids
really yet, only in a couple of small tests/examples when I first started
looking at .net - so any advice would be appreciated...

Regards

Rob
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.