BulletedList

  • Thread starter Thread starter Stan SR
  • Start date Start date
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
 
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>
 
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>
 
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>
 
Back
Top