Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 30th, 2004, 05:21 PM
methenyr methenyr is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 methenyr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Problem displaying gif nested in If Statement

I am trying to get a page working that will display an email graphic if there is an email address listed and display a filler transparent image 1pixelx1pixel if there is no email address or do nothing at all. I listed the code below and hope someone can possibly help figure out the problem. I am new to ASP and just doing this for a high school class website for classmates to contact each other. I am trying to do the same thing with a globe icon also where is only displays if they list a webpage in their profile but have not put any code for that one yet. Just been trying to get the email graphic to work first.
Code:

Code:
 <%
Do While Not objRS.EOF
stremail = objRS("Email")
%>
 
	<tr>
	 <td width="15%" align="center" height="27"><%=objRS("First_Name")%></td>
	 <td width="20%" align="center" height="27"><%=objRS("Middle_Name")%></td>
	 <td width="20%" align="center" height="27"><%=objRS("Last_Name")%></td>
<td width="20%" align="center" height="27"><%=objRS("Maiden_Name")%></td>
	 <td width="10%" align="center" height="27">
 
<% If stremail = "" then Response.Write ""<a href=http://class94.mydomain.com/alumni/sendmail.asp?AlumniID=" & (objRS("id") & "><img border='0' src='/class94/alumni/email.gif' width='20' height='20'>" & "</a>""
		Else Response.Write "<img border="0" src="/class94/alumni/transparent.gif" width="20" height="20" & ">"
end if%>
 
</td>
	 <td width="10%" align="center" height="27"><A HREF="<%=objRS("homepage")%>" Target="_blank">
	 <img border="0" src="/class94/alumni/homepage.gif" width="20" height="20"></a>
 
</td>
	</tr>
	<tr>
	 <td width="105%" bgcolor="#C0C0C0" colspan="6">
<hr>
	 </td>
	</tr>
<%
 
iCount = iCount +1
'Move on to the next alumni
objRS.MoveNext
Loop
%>

Last edited by methenyr : July 30th, 2004 at 05:22 PM. Reason: Changed title

Reply With Quote
  #2  
Old July 31st, 2004, 07:37 AM
bamboo bamboo is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 168 bamboo User rank is Private First Class (20 - 50 Reputation Level)bamboo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Not quite sure what your problem is, but here is a fix for part of your code. Quote marks were a bit misplaced. I'm also doing things a bit differently so I don't go crazy with the quote stuff. Change the path in the href as necessary.

Code:
  
<% 
If stremail = "" then %>
  <a href="alumni/sendmail.asp?AlumniID=<%=(objRS("id")%>"><img border=0 src="/class94/alumni/email.gif" width=20 height=20></a>
<%
Else %>
  <img border="0" src="/class94/alumni/transparent.gif" width="20" height="20">
<%
end if%>


Cheers,
Mike

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Problem displaying gif nested in If Statement


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway