data repeater - table layout vs schema

R

Rob Meade

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top