How to embed image control in a repeater?

  • Thread starter Thread starter Matthew Law
  • Start date Start date
M

Matthew Law

Hi,

I have a repeater in my vb.net page which needs to render an image
control (it's a mappoint linedrive map image). The repeater itself is
bound to an array of object 'Directions' which contains mostly
strings, but one of the Properties of the Direction Class is an image
of type System.Web.UI.WebControls.Image.

Obviously, if I try to render it in the repeater with the same
technique used for a string:

<%# Convert.ToString(DataBinder.Eval(Container.DataItem,
"LDMapImage")) %>

I get a string of 'System.Web.UI.WebControls.Image' instead of the
image itself.

I know I can do this with a table control but code using a repeater is
already in place so I'd prefer to use it. Can I do this with a
repeater and if so how?

Many thanks in advance,

Matthew.
 
You need to get the uri of the image into the repeater. Is 'LDMapImage' an object? And if so, can you get the path/uri/url attribute of it? Maybe LDMapImage.Path or something like that?
 
Back
Top