473,804 Members | 3,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 HtmlGenericCont rol, 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********@hotm ail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
1 30984
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.Data Item, "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********@hot mail.com> wrote in message news:%2******** ********@tk2msf tngp13.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 HtmlGenericCont rol, 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********@hotm ail.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
5384
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 hoping to make this as flexible as possible. Thanks, Mike
1
10037
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
2314
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 example : "This is my list :\n\r-list item 1\n\r-list item 2\n\r-list item 3\n\r\n\rThis was a great list." Let's say this outputs like that :
1
1086
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> <head> <title>Untitled</title> <style type="text/css"> * {margin: 0px; padding: 0px; border: 0px; border: 1px solid
1
3289
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 javascript and php to do things. the user clicks one of the links, and I want things to happen, I use the onclick event (of the li <li id="button1" onclick=getData(ajax HttpReq)) but I have 3 other things i would like to happen with the same...
3
3499
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
20124
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="" id="tab1"><a href="#remote-tab-7">General</a></li> <li class="" id="tab6"><a href="#remote-tab-8">Learning Management</ a></li>
5
11587
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 d=document.getElementById("forum"); d.parentNode.removeChild(d);
2
2225
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: <ul><liitem</li<li<ul... </ul></li></ul>? or does it matter?
0
9575
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10564
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10073
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9134
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7609
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5513
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.