Go to repeater to bind repeater nesting and call outer data in the inner layer

Source: Internet
Author: User
<Table border = "0" cellpadding = "0" cellspacing = "0" style = "margin-bottom: 5px" width = "100%"> <asp: repeater runat = "server" id = "rptypelist" onitemdatabound = "rptypelist_itemdatabound"> <itemtemplate> <tr> <TD class = "FB"> & nbsp; <a href = "lists. aspx? Qtid = <% # eval ("qtid") %> "> <% # eval (" qtypename ") %> </a> <span id = "askcount_15" class = "date2"> [<% # eval ("typecount ") %>] </span> </TD> </tr> <TD> <Div id = "asktop2_15" class = "ask_list"> <asp: repeater runat = "server" id = "rpquestionlist"> <itemtemplate> <a href = "question. aspx? Qid = <% # eval ("liftquestionid") %> "> <% # eval (" questiontitle ") %> </a> <br/> parent-level data: <% # databinder. eval (repeateritem) container. parent. parent ). dataitem, "qtid") %> parent sequence number: <% # (repeateritem) container. parent. parent ). itemindex %> </itemtemplate> </ASP: repeater> </div> </TD> </tr> </itemtemplate> </ASP: repeater> </table>
Private void repeater1bind () {// getquestiontypeandcount () returns a datatable this. rptypelist. datasource = liftquestionctr. getquestiontypeandcount (); this. rptypelist. databind ();} protected void evaluate (Object sender, repeateritemeventargs e) {// determine the position of the repeater in the repeater (alternatingitemtemplate, footertemplate, // headertemplate, itemtemplate, separatortemplate) if (E. item. itemtype = listitemtype. item | E. item. itemtype = listitemtype. alternatingitem) {repeater rep = E. item. findcontrol ("rpquestionlist") as repeater; // locate the repeater object datarowview rowv = (datarowview) E. item. dataitem; // locate the data item int typeid = convert associated with the repeater category. toint32 (rowv ["qtid"]); // obtain the ID rep of the fill subclass. datasource = liftquestionctr. getsomequestionsbytypeid (typeid, 2); rep. databind ();}}

 

Go to repeater to bind repeater nesting and call outer data in the inner layer

Related Article

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.