
October 27th, 2005, 02:09 AM
|
 |
Learner
|
|
Join Date: Nov 2004
Location: India
|
|
Hey u mean even if the condition is true the statements inside it are not executed????
Quote: | Originally Posted by bazzanoid Hi all,
I'm having a little trouble using an IF statement - could someone take a look at this code and point out the glaringly obvious error that prevents the whole page from loading properly when used? I can't see it for the life of me!
Code:
<%
Set Checkfile = Server.CreateObject("Scripting.FileSystemObject")
Set mypath = Server.MapPath("product/" & rstSearch.Fields("Supplier").Value & "/")
If Checkfile.FileExists(mypath & rstSearch.Fields("ProductName").Value & ".asp") Then %>
<td valign="middle" width="50">
<div align="center">
<a href="product.asp?supplier=<%= rstSearch.Fields("Supplier").Value %>&productid=<%= rstSearch.Fields("ProductID").Value %>">
<img border="0" src="thumbs/<%= rstSearch.Fields("ProductID").Value %>thumb.jpg"></a></div></td>
<td VALIGN="middle" align="left"><a href="product.asp?supplier=<%= rstSearch.Fields("Supplier").Value %>&productid=<%= rstSearch.Fields("ProductID").Value %>">
<font color="#000080">
<span onMouseOut="this.className='MouseOut';" onMouseOver="this.className='MouseOver';" class="MouseOut">
<%= rstSearch.Fields("ProductName").Value %>
</span></font></td>
<%
Else
%>
<td align="left" VALIGN="middle">
<%= rstSearch.Fields("ProductName").Value %></td>
<%
End If
%>
Each section of coding within the Then and Else statement works perfectly as i use this on separate parts of the site for where i specifically know the file does and does not exist, but this page is really to pull the extended info with link and graphic if it does exist, and to show just the basic if not.
Anyone see what I can't???
Thanks!
Barry |
|