RE: image in datagrid

Discussion in 'ASP .Net' started by =?Utf-8?B?UmljaGFyZA==?=, Mar 7, 2005.

  1. Here is what works for me, hope it helps. This assumes that you're just
    storing the path and name of your image in the table, not the actual image
    itself:
    <ItemTemplate>
    <asp:Image id=imgPhoto runat="server" ImageUrl='<%#
    Databinder.Eval(Container.DataItem, "image") %>'>
    </asp:Image>
    </ItemTemplate>

    "alex alexander via .NET 247" wrote:

    > I have a table in access called 'product' with a field called 'image' which lists text 'imagename.jpg' for whatever the image is.
    > I get the following error.
    >
    > DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name image.
    >
    > This is how I call it out:
    > <Columns>
    > <asp:TemplateColumn HeaderText="Image">
    > <ItemTemplate>
    > <img src='<%# DataBinder.eval(Container.DataItem, "image" )%>'/>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > </Columns>
    >
    > Can someone please help.
    > Thanks,
    > Alex
    >
    > -----------------------
    > Posted by a user from .NET 247 (http://www.dotnet247.com/)
    >
    > <Id>/5rCj0VxckOmTR7WNL+jAA==</Id>
    >
    =?Utf-8?B?UmljaGFyZA==?=, Mar 7, 2005
    #1
    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. Jerry J
    Replies:
    0
    Views:
    542
    Jerry J
    Jul 18, 2003
  2. Mike John
    Replies:
    0
    Views:
    506
    Mike John
    Jul 28, 2003
  3. Gary B

    Image can't hold an image?

    Gary B, Jul 31, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    344
    Steve C. Orr, MCSD
    Aug 1, 2003
  4. Laszlo Zsolt Nagy
    Replies:
    1
    Views:
    1,288
    Kartic
    Jan 26, 2005
  5. Andreas Klemt
    Replies:
    0
    Views:
    293
    Andreas Klemt
    Oct 8, 2003
Loading...

Share This Page