H
Howard
I need to generated a list from data from 2 database tables.
1st list CATEGORY consists of columns
CATID|CATEGORYNAME|
2nd table ITEM has columns
ID|CATEGORYID|NAME|
<asp:repeater id=parent datasourceid=ds1 runat=server>
<itemtemplate>
<h1><%# Eval("CATEGORYNAME")%></h1><ul>
<asp:repeater id=childdatasourceid=ds2 runat=server>
<itemtemplate>
<li><%# Eval("ID")%>. <%# Eval("NAME")%></li>
</itemteplate>
</asp:repeater></ul>
</itemteplate>
</asp:repeater>
The problem with this is the child repeater doesn't know which instance of
the parent repeater it belongs to.
The output looks like this
Category 1
Item 1 of category 1
Item 2 of category 1
Category 2
Item 1 of category 1
Item 2 of category 1
Category 3
Item 1 of category 1
Item 2 of category 1
....
How do you set up a relationship between the two objectdatasources (CATEGORY
and ITEM)?
The correct html output shoud look like this
Category 1
Item 1 of category 1
Item 2 of category 1
Category 2
Item 1 of category 2
Item 2 of category 2
Category 3
Item 1 of category 3
Item 2 of category 3
....
Thanks,
Howard
1st list CATEGORY consists of columns
CATID|CATEGORYNAME|
2nd table ITEM has columns
ID|CATEGORYID|NAME|
<asp:repeater id=parent datasourceid=ds1 runat=server>
<itemtemplate>
<h1><%# Eval("CATEGORYNAME")%></h1><ul>
<asp:repeater id=childdatasourceid=ds2 runat=server>
<itemtemplate>
<li><%# Eval("ID")%>. <%# Eval("NAME")%></li>
</itemteplate>
</asp:repeater></ul>
</itemteplate>
</asp:repeater>
The problem with this is the child repeater doesn't know which instance of
the parent repeater it belongs to.
The output looks like this
Category 1
Item 1 of category 1
Item 2 of category 1
Category 2
Item 1 of category 1
Item 2 of category 1
Category 3
Item 1 of category 1
Item 2 of category 1
....
How do you set up a relationship between the two objectdatasources (CATEGORY
and ITEM)?
The correct html output shoud look like this
Category 1
Item 1 of category 1
Item 2 of category 1
Category 2
Item 1 of category 2
Item 2 of category 2
Category 3
Item 1 of category 3
Item 2 of category 3
....
Thanks,
Howard