Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 18th, 2005, 03:02 PM
Authorized User
 
Join Date: Jul 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trouble with IF statement

Hello and thank you for taking a moment to read this message. I am trying to test for a value called sNamewith an IF statement.The statement tests for the value and assigns a particular url to a hyperlink. I cannot get this to work. If anybody has any insights to give I would be extremely greatful.

Thank You,
Jason


<%Do While Not rsItemsList.Eof
   surl = sNonSecurePath & "items.asp?CartId=" & sCartID & "&Mc=" & server.URLencode(rsItemsList("CODE"))

surlgrind=sNonSecurePath & "items_meatgrind_subcat.asp?CartId=" & sCartID & "&Mc=" & server.URLencode(rsItemsList("CODE"))

Call Displaylist(SName,surl,surlgrind)
rsItemsList.Movenext
Loop

Sub DisplayList(sName,surl,surlgrind)%>

If sName="Grinders" Then
<tr>
    <td valign="top" width="8%" align="right"><img src="images/dot.gif" width=5 height=5 vspace="6" border=0 alt=""></td>
<td valign="top" width="90%"><a class="featured" href=<%=surlgrind%>><%=sName%></a></td>
</tr>
ELSE
<tr>
    <td valign="top" width="8%" align="right"><img src="images/dot.gif" width=5 height=5 vspace="6" border=0 alt=""></td>
    <td valign="top" width="90%"><a class="featured" href=<%=surl%>><%=sName%></a></td>
</tr>
END IF
<%End Sub%>

 
Old October 19th, 2005, 04:43 AM
Registered User
 
Join Date: Apr 2005
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

Is it asp page? if so then your If ... Then statement should be in <% %> tag.

If sName="Grinders" Then
should be
<% If sName="Grinders" Then %>



Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble Using For Next Statement slbibs ASP.NET 2.0 Professional 9 September 19th, 2008 09:44 AM
Trouble with simple JOIN statement zoltac007 SQL Server ASP 1 May 31st, 2007 10:09 AM
Trouble executing SQL statement turbo_rabbit ASP.NET 1.0 and 1.1 Basics 13 July 6th, 2005 01:31 PM
Trouble with SQL statement jsanders ASP.NET 1.0 and 1.1 Basics 1 May 24th, 2005 03:11 PM
Trouble with mysql statement cbright JSP Basics 1 October 2nd, 2003 06:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.