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 4083712
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:20:52+00:00 2026-05-20T18:20:52+00:00

Basically, I’m asking for the best way to do the following: I have a

  • 0

Basically, I’m asking for the best way to do the following:
I have a layout like this

<div class="outer">
    <div class="inner"><!-- content --></div>
    <div class="inner"><!-- content --></div>
    <div class="inner"><!-- content --></div>
    <div class="inner"><!-- content --></div>
</div>
<div class="outer">
    <div class="inner"><!-- content --></div>
    <div class="inner"><!-- content --></div>
    <div class="inner"><!-- content --></div>
    <div class="inner"><!-- content --></div>
</div>
<div class="outer">
    <div class="inner"><!-- content --></div>
    <div class="inner"><!-- content --></div>
    <div class="inner"><!-- content --></div>
    <div class="inner"><!-- content --></div>
</div>

So, the outer div is to be repeated three times, with each inner div repeated four times. I’m doing this in ASP.net, the information is coming from a database (probably through Linq)…

I am asking is it better to use a nested repeater and spoon feed each repeater four records at a time through a for/foreach loop, or output the outer divs as literals?

EDITED

<asp:Repeater ID="MyOuterRepeater" runat="server">
    <ItemTemplate>
        <div class="outer">
        <asp:Repeater ID="MyInnerRepeater" runat="server">
            <ItemTemplate>
                <div class="inner">
                <!-- content -->
                </div>
            </ItemTemplate>
        </asp:Repeater>
        </div>
    </ItemTemplate>
</asp:Repeater>

Or just have one, with opening/ending literals at the top and bottom, making them visible only when needed?

EDIT: Does anybody have an example how it would be done^^^

  • 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-20T18:20:52+00:00Added an answer on May 20, 2026 at 6:20 pm


    Your repeater definition will not create resulting HTML that you also provided in your question. It should actually be:

    <asp:Repeater ID="MyOuterRepeater" runat="server">
        <ItemTemplate>
            <div class="outer">
                <asp:Repeater ID="MyInnerRepeater" runat="server">
                    <ItemTemplate>
                        <div class="inner">
                        <!-- content -->
                        </div>
                    </ItemTemplate>
                </asp:Repeater>
            </div>
        </ItemTemplate>
    </asp:Repeater>
    

    Otherwise your outer div will only be rendered once and all inner divs will be contained in the same outer div.

    Nesting repeaters?

    If your inner elements are dynamic depending on data, you should of course use nested repeaters, but if every outer will contain four inner, then I don’t see any benefit in having nested repeaters. It will actually execute slower and consume more resources. And that’s something you don’t want, do you?

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

Sidebar

Related Questions

Basically, I have a list of delivery checkboxes one for deliver to this address
Basically from a database I am getting data that is formatted like this nameofproject101
Basically I have a loop incrementing i, and I want to do this: var
Basically, the reverse of abs. If I have: if ($this.find('.pdxslide-activeSlide').index() < slideNum - 1)
Basically I have this server app I built in vc#, and for some reason
Basically, I have code where the user clicks a link, and then a div
Basically, I have a UIImageView that will loop through 8 PNGs over 0.5 seconds.
Basically I have a large set of data in excel, and I was wondering
Basically, what I'm trying to create is a page of div tags, each has
Basically I'm attempting to add rows to a table, I need to do this

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.