473,804 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BulletedList

Hi,

I want to add dynamically items within a bulletlist.
Everything works when I add text like

BulletedList mybullet;
mybullet.Items. Add("blabla");

But how to add an image (I m not talking about decoration-style)

I would like to get something like that :
<ul>
<li><img src="mypicture1 .gif" />One</li>
<li><img src="mypicture2 .gif" />Two</li>
</ul

Thanks for your help

Stan
Dec 19 '06 #1
3 1915
You can do it in a repeater:
<ul>
<asp:repeater runat="server">
<itemtemplate >
<li><img src="[expression for getting image url]" />[expression for getting
text]</li>
</itemtemplate>
</asp:repeater>
</ul>
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Stan SR" <st**@pasdepam. netsunset.comwr ote in message
news:eA******** ******@TK2MSFTN GP03.phx.gbl...
Hi,

I want to add dynamically items within a bulletlist.
Everything works when I add text like

BulletedList mybullet;
mybullet.Items. Add("blabla");

But how to add an image (I m not talking about decoration-style)

I would like to get something like that :
<ul>
<li><img src="mypicture1 .gif" />One</li>
<li><img src="mypicture2 .gif" />Two</li>
</ul

Thanks for your help

Stan


Dec 19 '06 #2

Thanks,
Is it possible to do it from code ?
Stan
You can do it in a repeater:
<ul>
<asp:repeater runat="server">
<itemtemplate >
<li><img src="[expression for getting image url]" />[expression for
getting
text]</li>
</itemtemplate>
</asp:repeater>
</ul>



--
Utilisant le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/
Dec 19 '06 #3
You can create in the code a collection (an ArrayList or just an array or
whatever else is appropriate in your case) containing the values for the
image url and the text and databind the repeater to the collection.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"Stan SR" <st**@pasdespam netsunset.comwr ote in message
news:op.tksybzf f4pnsbf@toshiba _stan...
>
Thanks,
Is it possible to do it from code ?
Stan
>You can do it in a repeater:
<ul>
<asp:repeate r runat="server">
<itemtemplat e>
<li><img src="[expression for getting image url]" />[expression for
getting
text]</li>
</itemtemplate>
</asp:repeater>
</ul>


--
Utilisant le client e-mail révolutionnaire d'Opera :
http://www.opera.com/mail/

Dec 19 '06 #4

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

Similar topics

6
7880
by: craptiger | last post by:
Is it possible to nest bulleted lists? I'm not overly competent at c# yet but have been given a project by my boss and it involves making a menu type control from a 3 level xml file. I've managed to build it by making one list, and dynamically adding items to it, but want to indent them by nesting lists within lists. Can anyone post a really simple example of how I might do this?
0
1184
by: benliu | last post by:
I have a bulletedlist that I have databound to a sqldatasource. I am using it with displaymode=hyperlink. I set the datatextfield to be one of the fields returned by the sqldatasource. However, with the url field, i would like to build the url from one of the fields returned. Specifically, the url is formed by setting a querystring value to the id returned in the field: http://localhost/news.aspx?nwId=533 So the datasource returns...
2
3980
by: Stan SR | last post by:
Hi, I need to add (dynamically) sub bulletedList to a bulletedList Ex : <ul> <li>store A <ul> <li>Europe</li> <li>Africa</li>
0
1715
by: Tony | last post by:
I want to display the text of items in a bulletedlist on multiple lines, but I can't get it working. Here is a sample version of my code below: protected void blStaff_DataBound(object sender, EventArgs e) { foreach (ListItem lstItem in ((BulletedList)sender).Items) { lstItem.Text = "A" + "<br>" + "B"; } }
5
2673
by: =?Utf-8?B?SmliZXkgSmFjb2I=?= | last post by:
Hi: I'm using the <asp:BulletedListcontrol in a TemplateField in a GridView. The extra height generated by this control increases the height of the rest of the row it's in. Is there a way around this? Thanks, Jibey
6
4713
by: Nathan Sokalski | last post by:
I am creating a BulletedList and would like to use a - as the bullet. However, I could not find a way to do this using the properties for the BulletedList control. Is there a way to use a specific character for the bullet without manually adding it to each ListItem? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
0
1085
by: Nathan Sokalski | last post by:
I am trying to create a BulletedList with multiple levels. However, I am having trouble creating the nested lists (lists other than the top level). Could somebody please help me figure out how to create nested BulletedLists? I am assuming that there is some way to do this using the BulletedList control since it generates ul tags, which can be used to create nested lists. Thanks. -- Nathan Sokalski njsokalski@hotmail.com...
1
3038
by: Hĺkan | last post by:
Hi! How do you format the href field of the <a>-tag when you use a databound BulletedList in Hyperlink mode? The field in the database contains an ID that I want to use as a parameter in the url for the Bulletedlists hyperlink tag. /Hĺkan
0
1176
by: ngchaitra | last post by:
hi, I am using bulletedlist control and have set displaymode as linkbuttons. And binding data to that. Till here it is working fine. Now when i select some link on that it has to move to some other page. but how to do this i am not able to retrieve the text from the bulleted list. I mean based on the value present in the bulletedlist i need to write the query. But finding difficult since it does not have either a text property or...
0
9716
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
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
10604
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
10354
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
10359
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
10101
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
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.