. Net repeater nested Data Binding

Source: Internet
Author: User

<Asp: repeater id = "repeater3" runat = "server"Onitemdatabound = "repeater3_itemdatabound">
<Itemtemplate>

BIND (data) // bound data

<Asp: repeater id = "repeater4" runat = "server">
<Itemtemplate>

BIND (data) // bound data

</Itemtemplate>
</ASP: repeater>

</Itemtemplate>
</ASP: repeater>

Bind repeater4 in the background

/// <Summary> /// Data Binding // bind a reply /// </Summary> /// <Param name = "sender"> </param> // /<Param name = "E"> </param> protected void repeater3_itemdatabound (Object sender, repeateritemeventargs e) {If (E. item. itemtype = listitemtype. item | E. item. itemtype = listitemtype. alternatingitem) {repeater rpt1 = E. item. findcontrol ("repeater4") as repeater; If (rpt1! = NULL) {repeater rep = (repeater) E. item. findcontrol ("repeater4"); datarowview rowv = (datarowview) E. item. dataitem; // locate the data item int typeid = convert associated with the repeater category. toint32 (rowv ["ID"]); // obtain the ID stringbuilder sb = new stringbuilder ("SELECT statement") of the fill subclass; sb. append ("Where condition (typeid used)"); dataset DS = maticsoft. dbutility. dbhelpersql. query (sb. tostring (); rep. datasource = Ds; rep. databind ();}}}

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.