best way to display categories on a .aspx page

D

DotNetNewbie

Hello,

I need to display a list of categories on the left side of a page, and
I am confused how I would do this using a List Control (as appose to
weaving my own HTML on the server side).

My HTML should look like:

<ul>

<li><a href="">Category</a>
<ul>
<li><a href="">Sub Category 1</a></li>
<li><a href="">Sub Category 2</a></li>
</ul>
</li>
<li><a href="">Category2</a>
<ul>
<li><a href="">Sub Category 1</a></li>
</ul>
</li>

</ul>

To make things complicated, maybe I want to ONLY show the top level
categories (Category, Category2). I also might want to highlight the
currently selected category.

If it was up to me, I would just do this using a StringBuilder in the
codebehind, but one of my requirements is that it has to be easy for
the web designers to go in and change the HTML markup.
 
L

Liz

I need to display a list of categories on the left side of a page, and
I am confused how I would do this using a List Control (as appose to
weaving my own HTML on the server side).

Have you considered using a Repeater control? It'll let you use pretty much
whatever template you need to output the HTML; I should think the design
people could do most or all of what they need to with CSS
 
D

DotNetNewbie

Have you considered using a Repeater control?  It'll let you use pretty much
whatever template you need to output the HTML;  I should think the design
people could do most or all of what they need to with CSS





- Show quoted text -

The problem is, how can I show an embedded repeater inside the
repeater? (and it might be n levels, like subcategories of the top
level category, but the sub categories could also have sub-sub
categories).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top