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
Yes you can, here is a simple example.
Markup:
Prep Test Code:
In your Page_Load or where you initialize the
Repeater:Output:
EDIT:
To bind to an
Arrayjust assign theArrayto theDataSourceand then access theArrayitems in your binding with: