Forums

ASP

This topic is locked

If no image then response.write(

Posted 06 Mar 2006 19:30:58
1
has voted
06 Mar 2006 19:30:58 Javier Castro posted:
Hi, please help me figure this out. I have catalogue online but some of my items have no images. When there is no image I would like to show a note: response.write("There is no images at this time." instead of the Icon of the image missing. I tried several ways but it ends up showing the response in all my records regardles if there is no image.

How would that be applied to the code below?

<% If (rsNeat.Fields.Item("product_image".Value) <> "" Then %>
<a href="#" onclick="MM_openBrWindow('cat_images/<%=(rsNeat.Fields.Item("product_image_big".Value)%>','','width=450,height=450')">
<img src="cat_thumbnails/<%=(rsNeat.Fields.Item("product_image".Value)%>" alt="" border="0" />
</a><% End If %>

thanks for any help.

Javier

Edited by - am7555 on 06 Mar 2006 19:31:27

Replies

Replied 07 Mar 2006 13:30:46
07 Mar 2006 13:30:46 Dave Thomas replied:
<% If (rsNeat.Fields.Item("product_image".Value) <> "" Then %>
<a href="#" onclick="MM_openBrWindow('cat_images/<%=(rsNeat.Fields.Item("product_image_big".Value)%>','','width=450,height=450')">
<img src="cat_thumbnails/<%=(rsNeat.Fields.Item("product_image".Value)%>" alt="" border="0" /></a>
<% Else %>
--your response write bit here--
<% End If %>

regards

Dave Thomas
<b>DMX Zone Forums Manager</b>
Tip: Use Google or our own Search function to find answers before asking. You'd be surprised what's already written <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>
Replied 10 Mar 2006 23:38:37
10 Mar 2006 23:38:37 Javier Castro replied:
Thanks Dave, it was right in front of me but desperation took the best of me, then you came and saved the day.
Cheers,

Javier

Reply to this topic