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 March 16th, 2005, 01:38 PM
Authorized User
Join Date: Feb 2005
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Double Quotes

This code displays data on webpage depending on outcome. Could someone please tell me whats wrong with this code, the double quotes are wrong after the last end if and i cant figure it out. Thanks.
the error i get is:

Microsoft VBScript compilation error '800a0409'

Unterminated string constant

"End If

"<form action=""CheckLogin.asp" & _
             "<%If Request(""WrongPw"")=""True"" Then" & _
                  "Response. Write ""?WrongPw=True""" & _
                "End If" & _
                "If Request(""NoTrader"") =""True"" Then" & _
                  "Response.Write ""?NoTrader=True""" & _
                "End If%>""" & _
                "name=""frmLogin"" method=""post"" >"

Old March 16th, 2005, 06:10 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post

try :

If Request("WrongPw")="True" Then
End If

If Request("NoTrader") ="True" Then

   ' do we already have a QueryString parameter
   if (Len(qs)>0) then
      qs=qs & "&"
      qs=qs & "?"
   end if

   qs=qs & "NoTrader=True"
End If


<form action="CheckLogin.asp<%=qs%>" name="frmLogin" method="post">
Old March 16th, 2005, 06:22 PM
Friend of Wrox
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41

There is a few things wrong with this, here is a fixed up version:
response.write "<form action='CheckLogin.asp"
If Request("WrongPw")= "True" Then
   Response.Write "?WrongPw=True'"
End If
If Request("NoTrader") = "" Then
   Response.Write "?NoTrader=True'"
End If
response.write " name='frmLogin' method='post'>"
1..IF conditions are not response.written and do no need to be sourounded by quotes. Paste your original version next to myn in your code editor, look at the code color difference (notePad will not show this - Homesite, EditPlus etc will show you)

2..If Request(""WrongPw"")= "True" : The form element name only needs on set of double quotes

3.."name=... : Should be " name=... Notice the space before the 'n' You always need a space between the properties of any tag. Lets say both conditions are false (no querystring appended) Your form tag would look like:
<form action='CheckLogin.asp'name='frmLogin' method='post'>
Should be
<form action='CheckLogin.asp' name='frmLogin' method='post'>

Wind is your friend

Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Double Quotes from a string Durkee VB.NET 2002/2003 Basics 12 October 4th, 2007 12:10 PM
double quotes MyronCope Classic ASP Basics 2 November 21st, 2006 09:31 AM
displaying single quotes and double quotes ren_123 Classic ASP Databases 2 February 22nd, 2006 02:17 PM
parsing with double quotes compcad Beginning VB 6 0 June 30th, 2004 12:48 AM
Double Quotes and Single Quotes Problem phungleon Classic ASP Basics 7 May 27th, 2004 01:44 PM

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