Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在父中继器中查找中继器的当前行?_C#_Asp.net - Fatal编程技术网

C# 如何在父中继器中查找中继器的当前行?

C# 如何在父中继器中查找中继器的当前行?,c#,asp.net,C#,Asp.net,您必须添加ItemCreated事件,并且可以使用e.Item.FindControl方法使用其id查找内部中继器 <asp:Repeater ID="rp1" runat="server"> <ItemTemplate> <ul> <li> <%#Module(Convert.ToInt32(Eval("id")),Eval("u

您必须添加ItemCreated事件,并且可以使用e.Item.FindControl方法使用其id查找内部中继器

<asp:Repeater ID="rp1" runat="server">
        <ItemTemplate>
            <ul>
                <li>
                    <%#Module(Convert.ToInt32(Eval("id")),Eval("university").ToString()) %>
                    <asp:Repeater ID="rp2" runat="server">
                    <ItemTemplate>
                    <ol>
                    <li id="sublist" runat="server">
                    <%#Eval("college") %>
                    </li>
                    </ol>
                    </ItemTemplate>
                    </asp:Repeater>
                </li>
            </ul>
        </ItemTemplate>
    </asp:Repeater>
public string Module(int id,string university)
    {
        con = new SqlConnection(ConStr);
        con.Open();
        cmd = new SqlCommand("SELECT college FROM tbluniversity where id=" + id, con);
        da = new SqlDataAdapter(cmd);
        con.Close();
        ds = new DataSet();
        da.Fill(ds);


//Here I want to find the inner repeator of current row then bind this dataset to that.
how to find Repeator


        return university;
    }