Show tif or pdf in DataList

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David C

    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="PicturesInF older" runat="server"
    CellPadding="3" Visible="true" BorderColor="Bl ack"
    ItemStyle-BorderWidth="1p t"
    ItemStyle-BorderColor="Bl ack" ItemStyle-BorderStyle="So lid" Width="540"
    RepeatDirection ="Horizontal "
    RepeatLayout="T able" RepeatColumns=" 3"
    OnItemDataBound ="PicturesInFol der_ItemDataBou nd">
    <ItemTemplate >
    <asp:Image runat="server" ID="Picture"
    ImageUrl='<%# Eval("FullName" ).ToString() %>' Width="180" Height="135" />
    </ItemTemplate>
    <AlternatingIte mStyle BackColor="Tran sparent" />
    </asp:DataList></td>


    David


  • =?Utf-8?B?SmVmZlAtPg==?=

    #2
    RE: Show tif or pdf in DataList

    "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="PicturesInF older" runat="server"
    CellPadding="3" Visible="true" BorderColor="Bl ack"
    ItemStyle-BorderWidth="1p t"
    ItemStyle-BorderColor="Bl ack" ItemStyle-BorderStyle="So lid" Width="540"
    RepeatDirection ="Horizontal "
    RepeatLayout="T able" RepeatColumns=" 3"
    OnItemDataBound ="PicturesInFol der_ItemDataBou nd">
    <ItemTemplate >
    <asp:Image runat="server" ID="Picture"
    ImageUrl='<%# Eval("FullName" ).ToString() %>' Width="180" Height="135" />
    </ItemTemplate>
    <AlternatingIte mStyle BackColor="Tran sparent" />
    </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.

    Comment

    • David C

      #3
      Re: Show tif or pdf in DataList

      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->" <JeffP@discussi ons.microsoft.c omwrote in message
      news:5A42F74B-A648-4517-B4EF-7A307EFD35E6@mi crosoft.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="PicturesInF older" runat="server"
      >CellPadding="3 " Visible="true" BorderColor="Bl ack"
      > ItemStyle-BorderWidth="1p t"
      >ItemStyle-BorderColor="Bl ack" ItemStyle-BorderStyle="So lid" Width="540"
      > RepeatDirection ="Horizontal "
      >RepeatLayout=" Table" RepeatColumns=" 3"
      >OnItemDataBoun d="PicturesInFo lder_ItemDataBo und">
      > <ItemTemplate >
      > <asp:Image runat="server" ID="Picture"
      >ImageUrl='<% # Eval("FullName" ).ToString() %>' Width="180" Height="135" />
      > </ItemTemplate>
      > <AlternatingIte mStyle BackColor="Tran sparent" />
      > </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.

      Comment

      Working...