Question : asp.net datalist showing images

Hi,

I have a datalist, that is bound to an sql data source which just reterives names of images
for example testimage1.jpg

I have done view source and taken the path from the note pad and pasted into run and the image is found

but for some reason on the browser the images are not disaplyed please help.

Thanks,

R8VI
1:
2:
3:
4:
5:
<asp:DataList ID="dl" runat="server" Visible="true" DataSourceID="SqlDataSource1">
            <ItemTemplate>
                <img border="0" width="75px" alt="image" height="75px" src='C:/T/TestWeb2/TestWeb/Images2/<%# DataBinder.Eval(Container, "DataItem.PictureName")%>' />
            </ItemTemplate>
        </asp:DataList>

Answer : asp.net datalist showing images

Always specify the application relative paths.

Try bewol code:


<asp:Image ID="imgId" runat="server" border="0" width="75px" alt="image" height="75px" ImageUrl='~/Images2/<%# DataBinder.Eval(Container, "DataItem.PictureName")%>' />

Random Solutions  
 
programming4us programming4us