I have a DataTable with the following content:
Category Vehicle_Num
Minivan 1
Minivan 2
Minivan 3
Caravan 1
Caravan 6
5door 1
5door 3
etc...
I want to print the results to an aspx page in the format:
<h2>Minivan</h2>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
<h2>Caravan</h2>
<ul>
<li>1</li>
<li>6</li>
</ul>
<h2>5door</h2>
<ul>
<li>1</li>
<li>3</li>
</ul>
I’m a little confused on how to do this in asp.net. In the PHP world, it’s easy for me to convert a data table into associative arrays, then print to template files. I’m wondering if that’s the same approach I need to take with asp.net.
It’s easy with two repeaters:
and in code behind something like this: