Results 1 to 8 of 8

Thread: [2005] DataList image problem [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271

    Unhappy [2005] DataList image problem [RESOLVED]

    Hi,

    I currently have a datalist, which displays an image.

    Currently the image is gained using:

    Code:
    <%# DataBinder.Eval(Container.DataItem, "stock_id", "images/stock/{0}.jpg") %>
    in the HTML, as you can see the images are stored in a directory not a DB, and they use the stock items ID. At the moment if the image doesnt exist it just shows the alt text.

    Is there something I can use on ItemDataBound to set the image to images/none.jpg if the image doesnt exist?

    I know I can use to FindControl to sweep over the list, but this assigns the image to ALL the images, which isnt what I want.

    Many Thanks,
    Last edited by §tudz; Apr 16th, 2007 at 02:22 PM.
    §tudz

    Studzworld.com - Portfolio

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width