473,404 Members | 2,174 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,404 software developers and data experts.

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 1895
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.comwrote in message
news:eA**************@TK2MSFTNGP03.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**@pasdespamnetsunset.comwrote in message
news:op.tksybzff4pnsbf@toshiba_stan...
>
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 #4

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

Similar topics

6
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...
0
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,...
2
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
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,...
5
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...
6
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...
0
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...
1
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...
0
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...

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.