Why image is not showing in repeater


D

Deep

dear friends

I am showing images in repeater this way. why it is not showing.

<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table border="1">
<tr>
<td>Image Title</td>
<td>Image Name</td>
<td>Image</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%#DataBinder.Eval(Container.DataItem,
"imageTitle" )%></td>
<td><%#DataBinder.Eval(Container.DataItem, "imageName")
%></td>
<td><asp:Image ID="Diamond" runat="server"
AlternateText="List Item Separator" ImageUrl='~/General/images/<
%#DataBinder.Eval(Container.DataItem, "imageName")%>' /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

Thanks in advance
 
Ad

Advertisements

A

Alexey Smirnov

dear friends

I am showing images in repeater this way. why it is not showing.

  <asp:Repeater ID="Repeater1" runat="server">
                <HeaderTemplate>
                <table border="1">
                <tr>
                <td>Image Title</td>
                <td>Image Name</td>
                <td>Image</td>
                </tr>
                </HeaderTemplate>
                <ItemTemplate>
                <tr>
                <td><%#DataBinder.Eval(Container.DataItem,
"imageTitle" )%></td>
                <td><%#DataBinder.Eval(Container.DataItem, "imageName")
%></td>
                <td><asp:Image ID="Diamond" runat="server"
AlternateText="List Item Separator" ImageUrl='~/General/images/<
%#DataBinder.Eval(Container.DataItem, "imageName")%>' /></td>
                </tr>
                </ItemTemplate>
                <FooterTemplate>
                </table>
                </FooterTemplate>
                </asp:Repeater>

Thanks in advance

ImageUrl='~/General/images/<
%#DataBinder.Eval(Container.DataItem, "imageName")%>'

You can't mix the coding it that way. Try to use

ImageUrl='<%# "/General/images/" + DataBinder.Eval(Container.DataItem,
"imageName")%>'

change "+" to "&" if it's on vb

Hope this helps
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top