all groups > asp.net webcontrols > may 2005 >
You're in the

asp.net webcontrols

group:

How do I create an Unordered List (UL) with ASP.NET?


How do I create an Unordered List (UL) with ASP.NET? Nathan Sokalski
5/30/2005 5:45:32 PM
asp.net webcontrols:
I want to add a bulleted list to my document in ASP.NET. I know the HTML
code, and I have used the HtmlGenericControl, but is there an ASP.NET object
that can generate UL and LI tags from a set of ListItem objects, or maybe
some other collection? Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

Re: How do I create an Unordered List (UL) with ASP.NET? Mona
5/31/2005 12:00:00 AM
Hi Nathan,

You can use the ASP.NET Repeater control for this purpose.

you can use the following code snippet for creating an unordered list
using the Repeater control:

<ul>
<asp:Repeater ID=3D"rpt1" Runat=3D"server">
<ItemTemplate>
<li>
<%# DataBinder.Eval(Container.DataItem, "Item") %>
</li>
</ItemTemplate>
</asp:Repeater>
</ul>

You can bind the Repeater to any Datasource or Collection Object such as =
a dataset or a datatable or an arraylistas per your need.

HTH

Mona[Grapecity]

[quoted text, click to view]
AddThis Social Bookmark Button