473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Show tif or pdf in DataList

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
Sep 17 '08 #1
2 1622
"David C" wrote:
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.
Sep 17 '08 #2
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

"JeffP->" <Je***@discussions.microsoft.comwrote in message
news:5A**********************************@microsof t.com...
"David C" wrote:
>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.

Sep 17 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: mahsa | last post by:
hi, do you have any idea how can I show some text on image button that show in datalist?
1
by: Raymond Du | last post by:
Hi, I have the following templates inside a datalist: <SelectedItemTemplate> &nbsp;<%# Container.DataItem("Title") %> </SelectedItemTemplate> <ItemTemplate> &nbsp;<asp:LinkButton...
1
by: lydia sista via DotNetMonster.com | last post by:
hi! help... How do you show/hide item's data? Like sale item on product catalogue. I want to show the sale image when the status of product is on sale. in my catalogue I use datalist:...
2
by: ad | last post by:
I have not any serial number in my table. But I want to show the serial number in my select result. Like: Select firstname, age from Employee: Jhon 38 Mary 40 Mimi 32 How to show :
0
by: Michel Couche | last post by:
Hello, I use a datalist to display the results of a search in a database of wines. One of the fields contains a full decsription of the wines. When a visitor makes a search, the results are...
3
by: Mirek Endys | last post by:
I have DataList as part of DataList item. DataList in DataList. The parent DataList working well including Edit command, that shows Edit template and correctly bind the data into edit template...
16
by: William Buchanan | last post by:
Hi folks I want to show 2 records on a page side by side. Each record has an image which will be displayed and a bit of text. How can I do this? Thanks Will
3
by: Mirnes | last post by:
Hello! How can I show data outside of data controls (gridview, listview etc.). I want to build CSS menu with data from database table and that is the reason why I need it outside of any data...
1
by: phuc2583 | last post by:
Hello everybody! I have some problem with my code but i can not do it,i tried my best to do this way or another way so i can... I have a page showsubject.aspx it contain to two datalist...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.