I will stick to the core code, this project because I am helping others to do, so temporarily can not open too much source code
(If you really want to source code, and so I help him at the end of October to promote the project to three floor, then open the current 1.0 version of the source Bar ~)
First of all, my purpose: according to the ID in Repeter1, nested query Repeter internal values (no way, my database is designed with three layers, so the code is ... )
Directly paste the core source code (in fact, the number of more than the interference line of sight)
1. Repeater1 Register Repeater1_itemdatabound Event <asp:repeater id= "Repeater1" runat= " Server " onitemdatabound=" Repeater1_itemdatabound "> <ItemTemplate> ............. <asp:textbox id= "Tbl_SayId" runat= "Server" text= ' <% #Eval ("Tbl_sayid") %> ' visible= ' False ' ></asp:TextBox> .............. <asp:repeater id = "Repeater2" runat= "Server" > <ItemTemplate> ............... </ itemtemplate> <alternatingitemtemplate> ............... </ Alternatingitemtemplate>&nBsp; </asp:repeater> </itemtemplate > </asp:Repeater>
Want a purpose? TextBox, what am I doing here? ~ Think of ... ~ ~ ~ (hidden, for the back or value)
If the direct access in the background is not Repeater2, must be accessed indirectly through Repeater1, and the method of configuration ObjectDataSource not work (my control is not very familiar with), so for Repeater2 I personal overdraft knock code, Here's a look at the backend code:
protected void Repeater1_itemdatabound (object sender, RepeaterItemEventArgs e) {Repeater r2 = (Repeater) e.item. FindControl ("Repeater2"); Get to Repeater2 TextBox txtID = (textbox) E.item.findcontrol ("Tbl_sayid"); Get the value you need for the DataTable dt = Say.getresays (txtID. Text); Query based on your values and return the results (say is a temporary tool Class I defined) R2. DataSource = DT; Develop the REPEATER2 data source R2. DataBind (); It's a bit of a waste of time if you don't really want to. Offer a sister, relax under the mood ~ hahaha, Flash ~
The school speed is too rubbish ... I want to be in the daytime.
"ASP" What! There's a repeater?! inside repeater.