Displaying an image using If Then Else statements

Results 1 to 2 of 2

Thread: Displaying an image using If Then Else statements

  1. #1
    Mark Newton Guest

    Default Displaying an image using If Then Else statements

    I am trying to get an if then else staement to display an image according to wether a condition is true or false, i am stuck on how to get the image file to display<BR><BR>&#060;% If Session("CIU1") = "true" then <BR>IMG SRC="../images/True.jpg"<BR> else<BR>IMG SRC="../images/False.jpg"<BR> End If<BR>%&#062;

  2. #2
    Jason Miller Guest

    Default RE: Displaying an image using If Then Else stateme

    Try something to the effect of <BR><BR>&#060;% if YOUR_CONDITION then imgSrc = "true.jpg" else imgSrc = "false.jpg" %&#062;<BR>&#060;img src="&#060;%= imgSrc %&#062;" ... (rest of HTML stuff here) ...&#062;<BR><BR>Alternately, something like the following would work...<BR>&#060;% if IS_BIRTHDAY then<BR> response.write "&#060;img src=""/img/h_bd.gif"" width=40 height=12 alt=""Happy bd!"" border=0&#062;" & vbCrLf<BR> else<BR> response.write "&#060;img src=""/img/m_ubd.gif"" width=80 height=30 alt=""A very Merry Unbirthday to You!"" border=0&#062;" & vbCrLf<BR> end if %&#062;<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •