Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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 July 30th, 2003, 05:30 PM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using quotes in VBSCript and an asp page

Please help a fairly new user of both VBScript and asp pages:

I have a form on what we'll call page1.htm that brings a variable called name into page2.asp. I then want to take this same variable from the first asp page (page2.asp) to another asp page (page3.asp) to use there as well. This is the code line I'm using to do this:

link = "page3.asp?gradname=" & name

the link variable is then used here:

<a class="ul" href="<%=link%>">Click Here</a>

Now, when I hover over the link created by the "Click Here" html tag, I can see the address the link will take me in the bottom left of my browser screen:

http://folder/folder/page3.asp?gradname=mr ed

where "mr ed" is the variable (called name) which I entered on page1.htm. So, the value of my variable has at least made it to this point. This code doesn't seem to want to work however, or I believe the variable isn't making it on to page3.asp, and I think this is because the above line has to look like:

http://folder/folder/page3.asp?gradname="mr ed"

(notice added quotes around variable). Not sure how to get these quotes added in so my code will work, please advise. I would also be open to other ways of doing this. Thank You.

 
Old July 30th, 2003, 08:13 PM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

The quotes are not required.
Your code looks fine.
How are you refering to the variable on page 3.
are you using:

request("gradname")
or to write to the page
<%= request("gradname")%>

?
Have a look at the address bar on page 3 it should look something like

folder/page3.asp?gradname=mr%20ed

For future reference if you need to use a double quote in a string you escape it by using two double quotes.
eg strVariable = "This is a ""quote"" in your string"
So
<%= strVariable %>

Would look like

This is a "quote" in your string

Rod

======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old July 31st, 2003, 10:30 AM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the help, didn't know about the double quote thing. I think I figured out what I'm missing.





Similar Threads
Thread Thread Starter Forum Replies Last Post
displaying single quotes and double quotes ren_123 Classic ASP Databases 2 February 22nd, 2006 02:17 PM
Putting VBScript in an ASP.NET page jturlington ASP.NET 1.0 and 1.1 Basics 1 May 14th, 2005 09:00 PM
Optimization of ASP page with VBScript anandham VBScript 0 April 18th, 2005 05:03 AM
Inserting "Double Quotes" ASP?VBScript/SQL Server craigcsb Classic ASP Databases 1 July 4th, 2003 10:37 PM





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