Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Display content is datafield is not empty

Posted 21 Jun 2004 11:19:40
1
has voted
21 Jun 2004 11:19:40 xircolaluna potto posted:
Hi,

I am working on a site in ASP.net / VB within Dreamweaver MX2004.

The problem I am having is that I cannot find a way to not display a datafield within a dataset when it is empty. It seems Dreamweaver only gives you this option on datasets, not on members of the dataset.

To give a clear example of my problem; for example a user adds text to a page and has the option to upload an image aswell.
When he wouldn't upload an image a missing image link icon will be shown on the page <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle> .

Can anyone help me out on this.
Thx,
Scott.

Replies

Replied 21 Jun 2004 12:46:46
21 Jun 2004 12:46:46 Simon Martin replied:
I've not looked at .net yet... so excuse my syntax
I've used this in old ASP to conditionally display the image

&lt;% if rs_user("image" &lt;&gt; "" then %&gt;
&lt;img src = "rs_user("image"" /&gt;
&lt;% else %&gt;
&lt;img src = "images/noimage.gif" /&gt; (or nothing)
&lt;% end if %&gt;

HTH

Simon

Reply to this topic