Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Images in a conditional region

Posted 23 Jun 2004 07:23:10
1
has voted
23 Jun 2004 07:23:10 David Forshaw posted:
Hi

In ASP VB Script.

Can you place images from a recorset in a conditional region?

Its not happening for me <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>

Here is my code:

&lt;% if rsDetails.Fields.Item("detailedImage".Value &lt;&gt; "" then ' Adv
Conditional Region %&gt;
&lt;table width="100%" border="0" cellspacing="0"
cellpadding="0"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img
src="&lt;%=(rsDetails.Fields.Item("detailedImage".Value)%&gt;"
class="imageBorder"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;% end if ' rsDetails.Fields.Item("detailedImage".Value
&lt;&gt; "" %&gt; &lt;br&gt;


Its not working with the conditional region just aroung the image also.

All I get from this is the dreaded little red box. But the images displays
correctly when the region is not there.

Thanks
Enzo

Replies

Replied 23 Jun 2004 11:42:07
23 Jun 2004 11:42:07 Simon Martin replied:
Sure can...
Why have you got that last line in there after the end if though?

My code below shows an image if it exists in a recordset, otherwise it just displays a default graphic
&lt;% If rsUserproperty.Fields.Item("picture".Value &lt;&gt;"" Then %&gt;
&lt;img src="photos/&lt;%=(rsUserproperty.Fields.Item("picture".Value)%&gt;" width="200" /&gt;
&lt;% Else %&gt;
&lt;img src="images/wireframe.gif" /&gt;
&lt;% End If %&gt;

HTH

Simon

Edited by - ganseki on 23 Jun 2004 11:43:47

Reply to this topic