Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display default image if lookup image doesn't exist

Status
Not open for further replies.

PushCode

Programmer
Dec 17, 2003
573
US
I've got a sharepoint picture library that holds product images, each of which has the product number in the file name (like 4300083-0-250x188, where 4300083 is the part number). On my page, I'm displaying product images dynamically by querying the db for the part_number then using that part number to display the correct image...like this: <asp:Image ID="img" Runat="Server" ImageUrl='<%# "/Parts/" + Eval("Part_Number") + "-0-250x188.jpg" %>' />

Works fine, but what I want to do is display a default image anytime the desired image doesn't exist. There are instances in which there are part numbers in the database but not in the picture library.

Is there an easy way to do this?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top