I am dynamically generating my navigation with .net using a repeater.
Laying out my navigation in this way presents a problem when sub nav items are generated the <ul> and </ul> tags are always written to the browser even if the sub nav contains no items. In the following example its item 2 thats causing the bother.
E.G
<ul>
<li>item 1
<ul>
<li>Item 1-1</li>
<li>Item 1-2</li>
<li>Item 1-3</li>
</ul>
</li>
<li>Item 2
<ul>
</ul>
</li>
<li>Item 3
<ul>
<li>Item 3-1</li>
<li>Item 3-2</li>
<li>Item 3-3</li>
</ul>
</li>
</ul>
As the <ul> and </ul> tags are written to the browser this means that when my nav is styled client side it creates an empty drop down menu. Is there any css style that I can define to collapse the empty <ul> </ul>?