In a general website, user controls of browsing categories are usually located on the left of most ASP. NET pages, which enables users to quickly search for products by category. Recently, I met a customer who asked to add products based on the original category browsing because there are not many products displayed on his website. In addition, the length of the left navigation bar is extended to make the page more harmonious. The original category navigation bar is implemented by Repeater. Now we need to add the product information of this category under each category, so I thought of embedding Repeater in the original Repeater. The implementation interface is as follows:
Front-end page:
<Asp: RepeaterId= "RptCategories"Runat= "Server">
<HeaderTemplate>
<TableWidth= "100%"Border= "0"Cellspacing= "0"Cellpadding= "0">
</HeaderTemplate>
<ItemTemplate>
<! --Category name-->
<Tr> <Th><%# DataBinder.Eval(Container. DataItem,"TypeName")%></Th> </Tr>
<! --Products under category-->
<Asp: RepeaterId= "RptProduct"Runat= "Server">
<ItemTemplate>
<Tr> <Td> <AHref= ProductInfo. aspx? Id = <% #DataBinder. Eval (Container. DataItem, "ID") %>><%