How to embed image control in a repeater?

Discussion in 'ASP .Net' started by Matthew Law, Jul 23, 2004.

  1. Matthew Law

    Matthew Law Guest

    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.
     
    Matthew Law, Jul 23, 2004
    #1
    1. Advertising

  2. 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?

    "Matthew Law" wrote:

    > 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.
    >
     
    =?Utf-8?B?TSBL?=, Jul 23, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Helixpoint

    embed an image in an HTML email.

    Helixpoint, Jul 14, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    542
    J. Ptak
    Jul 16, 2003
  2. Replies:
    0
    Views:
    859
  3. Big Dave
    Replies:
    0
    Views:
    706
    Big Dave
    Mar 10, 2005
  4. Matthew Law

    How to embed image control in a repeater?

    Matthew Law, Jul 23, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    175
  5. Tim
    Replies:
    0
    Views:
    205
Loading...

Share This Page