Forums

ASP

This topic is locked

Display an image based on value

Posted 01 Nov 2007 22:06:25
1
has voted
01 Nov 2007 22:06:25 Craig Griffith posted:
I'm trying to write a page which displays a greendot.gif for a SQL record integer value above a specified number and a red dot.gif below it (and none for null). Not sure if anyone has covered this before but any help would be great.

Thanks
CG


p.s. a little clarification... I'm displaying hard drive free space (collected in a SQL database view), and the current asp page displays the actual value. What I'm driving at is to use a green dot to represent any value over say 10Gb and a red dot for everything less (other than NULL, which I don't want to use any image for).



Edited by - a1weatherman on 02 Nov 2007 02:52:45

Replies

Replied 13 Nov 2007 16:34:56
13 Nov 2007 16:34:56 Seb Adlington replied:
Hi Craig,

You need to use a bit of Javascript - or VBscript if you prefer. Something like

<%if(SQLIntegerValue > 1000){%>
<img src="green.gif">
<%}else{%>
<img src="red.gif">
<%}%>

Cheers

Seb

Reply to this topic