BulletedList

S

Stan SR

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
 
E

Eliyahu Goldin

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>
 
S

Stan SR

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>
 
E

Eliyahu Goldin

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 said:
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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top