Conditionally display images from database

P

Paolo Pignatelli

I have a database containing an ImageURL3 column, in which the default is
~/Images/No-Image.gif .

I would like to dispaly the images from the column in a webpage,l as long as they are not the No-Image "image" (a one pix gif).

I get the values to displa fine by coding:

ImageURL1.ImageUrl = myProductDetails.ImageURL1



For examploe ,but, how do I tell the ASP Image contrlo not to display when the value is ~/Images/No-Image.gif ?

I tried

If Not ImageURL4.ImageUrl = "~/Images/No-Image.gif" Then

ImageURL4.ImageUrl = myProductDetails.ImageURL4

End If



But still get the No-Image.gif. (I also tried to make it invisible, but no luck).



Thanks for any help,



Paolo
 
P

Paolo Pignatelli

Found out how to do this a minute after IO posted...
If myProductDetails.ProductPrice.ToString = 0 Then

lblProductPrice.Visible = False

End If



Blah blah...

Thanks all,



Paolo

I have a database containing an ImageURL3 column, in which the default is
~/Images/No-Image.gif .

I would like to dispaly the images from the column in a webpage,l as long as they are not the No-Image "image" (a one pix gif).

I get the values to displa fine by coding:

ImageURL1.ImageUrl = myProductDetails.ImageURL1



For examploe ,but, how do I tell the ASP Image contrlo not to display when the value is ~/Images/No-Image.gif ?

I tried

If Not ImageURL4.ImageUrl = "~/Images/No-Image.gif" Then

ImageURL4.ImageUrl = myProductDetails.ImageURL4

End If



But still get the No-Image.gif. (I also tried to make it invisible, but no luck).



Thanks for any help,



Paolo
 

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,054
Latest member
TrimKetoBoost

Latest Threads

Top