Front-end code:
<Div id = "firstpane" class = "menu_list">
<Asp: repeater id = "rep1" runat = "server" onitemdatabound = "rep1_itemdatabound">
<Itemtemplate>
<P class = "menu_head" id = "P <% # eval (" p_typeid ") %>"> <% # eval ("type_name") %> </P>
<Div class = "menu_body" id = "Div <% # eval (" p_typeid ") %>">
<Asp: repeater id = "rep2" runat = "server">
<Itemtemplate>
<A id = "A <% # eval (" p_typeid ") %>" href = "media. aspx? Types = <% # eval ("p_typeid") %> & ptypeid = <% # eval ("p_typepid") %> ">
<% # Eval ("type_name") %> </a>
</Itemtemplate>
</ASP: repeater>
</Div>
</Itemtemplate>
</ASP: repeater>
</Div>
Background code:
Protected void rep1_itemdatabound (Object sender, repeateritemeventargs E)
{
// Determine the position of the layer repeater in the outer repeater (alternatingitemtemplate (this template defines how to display the alternate items in the control), footertemplate (Script Template ),
// Headertemplate, itemtemplate, and separatortemplate ))
If (E. Item. itemtype = listitemtype. alternatingitem | E. Item. itemtype = listitemtype. item)
{
If (E. Item. findcontrol ("rep2 ")! = NULL)
{
Datarowview DV = (datarowview) E. Item. dataitem; // locate the data item associated with the repeater category
String pid = DV. Row ["p_typeid"]. tostring (); // obtain the ID of the fill subclass.
Repeater Rp = (repeater) E. Item. findcontrol ("rep2"); // locate the repeater object in the layer
RP. datasource = product. getp_typebyid (convert. toint32 (PID), oledbhelp. conncn );
RP. databind ();
}
}
}