Complex nested repeater

H

Howard

I need to generated a table from data from 2 database tables.
1st table CATEGORY consists of
CATID|CATEGORYNAME|
2nd table is ITEM
ID|CATEGORYID|NAME|

The html output shoud look like this

Category 1
1. Item
2. Item
Category 2
3. Item
4. Item
Category 3
5. Item
6. Item
....

I tried to use the reapeater control, everything seemed to work perfectly,
but theres one problem. I cannot pass data to the child repeater. The
control doesn't take dynamic variables.
the child repeater doesn't know which parent category they belong to.


<asp:repeater id=parent datasourceid=ds1 runat=server>
<itemtemplate><%# Eval("CATEGORYNAME")%>
<asp:repeater id=childdatasourceid=ds2 runat=server>
<itemtemplate><%# Eval("ID")%>. <%# Eval("NAME")%></itemteplate>
</asp:repeater>
</itemteplate>
</asp:repeater>
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top