Nesting in Repeater Using Repeater

xiaoxiao2021-03-05  25

The user controls of the browsing category in a general website are usually located on the left of most ASP.NET pages, which allows users to quickly find products at categories. I have recently encountered a customer, because there is not much product displayed on his website, so it is required to add products on the basis of the original category. It is more convenient to extend the length of the left navigation bar to make the page more coordinated. The original classified navigation bar is implemented by the Repeater, and now you need to join the product information of this class under each category, so I thought in the original REPEATER. REPEATER. The implementation interface is as follows:

Front page section:

<

ASP: REPEATER

id

= "RPTCategories"

Runat

= "Server"

>

<

Headertemplate

>

<

TABLE

Width

= "100%"

Border

= "0"

Cellspacing

= "0"

Cellpadding

= "0"

>

Headertemplate

>

<

ItemTemplate

>

Category Name

->

<

TR

> <

TH

>

<%

# DataBinder.eval (Container.DataItem, "Typename")

%>

TH

>

TR

>

Classification product

->

<

ASP: REPEATER

id

= "rptproduct"

Runat

= "Server"

>

<

ItemTemplate

>

<

TR

> <

TD

> <

a

HREF

= 'Productinfo.aspx? Id = <% #

DataBinder.eval (Container.DataItem, "ID")%

>

"

<%

# DataBinder.eval (Container.DataItem, "ProductName")

%>

a

>

TD

>

TR

>

ItemTemplate

>

ASP: REPEATER

>

ItemTemplate

>

<

Footertemplate

>

TABLE

>

Footertemplate

>

ASP: REPEATER

>

Backstage code part (partial code):

//

Bind the product under the binding classification product

Private

Void

RPTCATEGORIES_ITEMDATABOUND

Object

Sender, System.Web.ui.WebControls.repeaterItemGTARGS E)

转载请注明原文地址:https://www.9cbs.com/read-35426.html

New Post(0)