how to display image on a repeater
-
hi. i used repeater to display my records. i want to add an image next to it. if there are 30 records, i want 30 similar images beside that. how to do it in asp/vb.net? any ideas? thanks.. :D:confused:
-
hi. i used repeater to display my records. i want to add an image next to it. if there are 30 records, i want 30 similar images beside that. how to do it in asp/vb.net? any ideas? thanks.. :D:confused:
If you want the same image in each one, then just put the
<img src="..."/>
tag inside the repeater'sItemTemplate
, wherever you want it positioned in relation to the other ItemTemplate content. If you want the source of the image to be data-driven, you can still put the<img>
tag in your ItemTemplate, then use databinding syntax<%# ... %>
for thesrc
attribute. Something like this:<img src='<%# DataBinder.Eval(Container.DataItem, "MyImageField") %>' />
In this context,
MyImageField
would be the name of a field (if your source were say aDataTable
) or a property (if your source were an object). -
If you want the same image in each one, then just put the
<img src="..."/>
tag inside the repeater'sItemTemplate
, wherever you want it positioned in relation to the other ItemTemplate content. If you want the source of the image to be data-driven, you can still put the<img>
tag in your ItemTemplate, then use databinding syntax<%# ... %>
for thesrc
attribute. Something like this:<img src='<%# DataBinder.Eval(Container.DataItem, "MyImageField") %>' />
In this context,
MyImageField
would be the name of a field (if your source were say aDataTable
) or a property (if your source were an object).thank you so much.. can i just use the picture from my folder?
-
thank you so much.. can i just use the picture from my folder?
how to display image on a repeater