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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:46:37+00:00 2026-05-28T04:46:37+00:00

Supposing I have a set of comma separated lists which I need to display

  • 0

Supposing I have a set of comma separated lists which I need to display into a Repeater, how would I?

So,

List1 = "1, 2, 3, 4"
List2 = "a, b, c, d"

If I convert these to arrays, how do I bind them to a Repeater and get the values of each list within the Repeater?

I want to get an HTML output that looks like this:

<div>
    <span> CONTENT TO LIST 1(0) </span>
    <span> CONTENT OF LIST 2(0) </span>
</div>

<div>
    <span> CONTENT TO LIST 1(1) </span>
    <span> CONTENT OF LIST 2(1) </span>
</div>
.... etc
  • 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-28T04:46:37+00:00Added an answer on May 28, 2026 at 4:46 am

    Yes you can, here is a simple example.

    Markup:

    <asp:Repeater ID="rpTest" runat="server">
        <ItemTemplate>
            <div id="row<%# Eval("ID").ToString() %>">DIV CONTENT</div>
        </ItemTemplate>
    </asp:Repeater>
    

    Prep Test Code:

    public class TestObject
    {
        public int ID { get; set; }
        public string Text { get; set; }
    }
    

    In your Page_Load or where you initialize the Repeater:

    List<TestObject> lst = new List<TestObject>();
    lst.Add(new TestObject() { ID = 0, Text = "Zero" });
    lst.Add(new TestObject() { ID = 1, Text = "One" });
    lst.Add(new TestObject() { ID = 2, Text = "Two" });
    lst.Add(new TestObject() { ID = 3, Text = "Three" });
    
    rpTest.DataSource = lst;
    rpTest.DataBind();
    

    Output:

    <div id="row0">DIV CONTENT</div>     
    <div id="row1">DIV CONTENT</div>     
    <div id="row2">DIV CONTENT</div>    
    <div id="row3">DIV CONTENT</div>
    

    EDIT:

    To bind to an Array just assign the Array to the DataSource and then access the Array items in your binding with:

    <%# Container.DataItem %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Supposing I have one perl in /usr/bin (which came along with my os-distribution) and
I have a set of .NET applications running in a public web environment which
Supposing I have a 2 dimensional array which was created with something like this,
Supposing I have a class Item, which has three member variables: string name, decimal
I have a set of images over which I run an OCR application. This
I have something like this <c:set var=x value=a /> Supposing I have a map
We have some part of our application that need to load a large set
Supposing I have a StringerHelper(Component|Helper|Behaviour).php class with a method for random strings. I might
Supposing I have 3 tables: Users, Roles and UserRoles. I can fetch the user_roles
Supposing I have this: foo bar 1 and foo bar 2 How can I

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.