Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 307711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:35:01+00:00 2026-05-12T07:35:01+00:00

I have a nested repeater control that displays a list of data, in my

  • 0

I have a nested repeater control that displays a list of data, in my case it is an FAQ list. here is the design portion:

<asp:Repeater ID="lists" runat="server">
    <ItemTemplate>
        <h2 class="sf_listTitle"><asp:Literal ID="listTitle" runat="server"></asp:Literal></h2>

        <p class="sf_controlListItems">
            <a id="expandAll" runat="server">
                <asp:Literal ID="Literal1" runat="server" Text="<%$Resources:ExpandAll %>"></asp:Literal>
            </a>
            <a id="collapseAll" runat="server" style="display:none;">
                <asp:Literal ID="Literal2" runat="server" Text="<%$Resources:CollapseAll %>"></asp:Literal>
            </a>
        </p>

        <ul class="sf_expandableList" id="expandableList" runat="server">
            <asp:Repeater ID="listItems" runat="server">
                <HeaderTemplate>
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <h1 id="headlineContainer" runat="server" class="sf_listItemTitle">
                            <a id="headline" runat="server" title="<%$Resources:ClickToExpand %>"></a>
                        </h1>
                        <div id="contentContainer" runat="server" class="sf_listItemBody" style="display:none;">
                            <asp:Literal ID="content" runat="server"></asp:Literal>
                        </div>
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                </FooterTemplate>
            </asp:Repeater>
        </ul>
    </ItemTemplate>
</asp:Repeater>

The repeater that I am interested in is the second repeater, listItems. In my code-behind, I cannot directly call listItems and see the controls inside of it. I tried to grab the control inside of list.DataBinding (maybe I need to use a different event?) method:

void lists_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
    var oRepeater = (Repeater) lists.FindControl("listItems");
}

but this comes up as null. Can anyone give me some pointers/tips of what I need to do to gain access to the listItems repeater and it’s children controls?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:35:01+00:00Added an answer on May 12, 2026 at 7:35 am
    lists
    

    belongs to each RepeaterItem, not directly to the Repeater itself.

    Try :-

    void lists_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
    
    
        if ( e.Item.ItemType == ListItemType.AlternatingItem 
            || e.Item.ItemType == ListItemType.Item )
        {
           Repeater oRepeater = (Repeater)e.Item.FindControl("listItems");
    
           // And to get the stuff inside.
           foreach ( RepeaterItem myItem in oRepeater.Items )
           {
              if ( myItem.Item.ItemType == ListItemType.AlternatingItem 
                  || myItem.Item.ItemType == ListItemType.Item )  
              {
                 Literal myContent = (Literal)myItem.FindControl("content");
    
                 // Do Something Good!
                 myContent.Text = "Huzzah!";
    
              }
           }
        }
    }
    

    And you should be good 🙂

    Edited to incorporate DavidP’s helpful refinement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a nested repeater control. Here is what the HTML looks like: <ItemTemplate>
I have a nested repeater Because of that no control in my code is
I have a design question. I have a nested repeater structure that is 4
I have an ASP.NET page that uses a repeater nested within another repeater to
I have a user control nested in a repeater. Inside my user control I
I'm working on a navigation control. I have nested lists which creates this: What
I have a nested Repeater control in the ItemTemplate of another Repeater. I want
I have a nested repeater set up but the child repeater control is not
I have a drop down list in asp.net using nested for loops in a
I have a gridview control nested within a repeater control. The repeater control is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.