473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
1 30882
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="rpt1" Runat="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]

"Nathan Sokalski" <nj********@hotmail.com> wrote in message news:%2****************@tk2msftngp13.phx.gbl...
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
nj********@hotmail.com
http://www.nathansokalski.com/

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael Champagne | last post by:
Does anyone have any examples or links to examples of generating a simple unordered list menu with multiple levels from an XML file? We are redesigning the navigation on our website and I was...
1
by: michael | last post by:
Good Morning, I have an unordered list similar to: <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul>
5
by: ibiza | last post by:
Hi all, I have a question which I have no ideal of the answer...I am currently working on a web application and at some time, I have a string representing a short text. This could be a simple...
1
by: simplico | last post by:
I'm creating an unordered list that fits in a defined width on the left side of the page. It works fine in FF but IE is another story. Here is a watered-down version of the code: <html>...
1
by: Eric Jones | last post by:
Hello newsgroup members, I really like CSS, and have created some button like navigation UL/li, etc. I have hover, change color, etc. I am using the "link" as a button, and using ajax and...
3
by: User | last post by:
Hi, Is it possible to transform Ordered/Unordered list into navigation dropdown menus? Is this effect achieved by CSS? or via Javascript? PLease advise Thanks.
1
by: laredotornado | last post by:
Hi, Is there a cross-browser way to keep the items of an unordered list on the same line (horizontal plane)? This is the code I'm working with <ul class="tabs-nav"> <li class=""...
5
by: ranyeng | last post by:
Suppose I have an Unordered List in my HTML file: <html> <head> <SCRIPT LANGUAGE="JavaScript"> function remove(){ //code to remove the old elements var...
2
by: asc4john | last post by:
When including an unordered list in an unordered list: Should it be included as a "list" item as in: <ul><liitem</ li><ul.... </ul<liitem</li</ul> or included in the LI element as in:...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.