<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