Show tif or pdf in DataList

D

David C

I have a DataList control that shows jpg and gif images just fine. I am
filling the DataList from a list of files in a directory. The directory
might contain tif and pdf files but all that shows in the DataList is the
red X for these files. Am I asking it to do something that is not possible?
If not, are there any alternatives to showing a reduced image for other file
types in a DataList? Thanks.
My DataList control is shown below.

<asp:DataList ID="PicturesInFolder" runat="server"
CellPadding="3" Visible="true" BorderColor="Black"
ItemStyle-BorderWidth="1pt"
ItemStyle-BorderColor="Black" ItemStyle-BorderStyle="Solid" Width="540"
RepeatDirection="Horizontal"
RepeatLayout="Table" RepeatColumns="3"
OnItemDataBound="PicturesInFolder_ItemDataBound">
<ItemTemplate>
<asp:Image runat="server" ID="Picture"
ImageUrl='<%# Eval("FullName").ToString() %>' Width="180" Height="135" />
</ItemTemplate>
<AlternatingItemStyle BackColor="Transparent" />
</asp:DataList></td>


David
 
J

JeffP->

David C said:
I have a DataList control that shows jpg and gif images just fine. I am
filling the DataList from a list of files in a directory. The directory
might contain tif and pdf files but all that shows in the DataList is the
red X for these files. Am I asking it to do something that is not possible?
If not, are there any alternatives to showing a reduced image for other file
types in a DataList? Thanks.
My DataList control is shown below.

<asp:DataList ID="PicturesInFolder" runat="server"
CellPadding="3" Visible="true" BorderColor="Black"
ItemStyle-BorderWidth="1pt"
ItemStyle-BorderColor="Black" ItemStyle-BorderStyle="Solid" Width="540"
RepeatDirection="Horizontal"
RepeatLayout="Table" RepeatColumns="3"
OnItemDataBound="PicturesInFolder_ItemDataBound">
<ItemTemplate>
<asp:Image runat="server" ID="Picture"
ImageUrl='<%# Eval("FullName").ToString() %>' Width="180" Height="135" />
</ItemTemplate>
<AlternatingItemStyle BackColor="Transparent" />
</asp:DataList></td>

David

To shed some light on your issue, you should view the resulting webpage
source with the image tag and it's image path.

If the path is NOT to an ~/images/ folder w/in your webapp, you should try
placing a few sample images as such - storing images in other locations where
permissions, mappings are not universal could be your problem.

If this is still an issue, you may wish to post a followup with any new
considerations or responces to the points I've raised.
 
D

David C

Jeff,
The DataList does generate img html tags as output and the src is a path to
the file.
The images are in a virtual directory on the website e.g. /photos so
permissions is not an issue.

p.s. Do you know how I could create a stream for these images and populate
the DataList? I have not worked with Streams before. Thanks.

David
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top