|
|
 |
| 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

July 30th, 2003, 06:30 PM
|
|
Registered User
|
|
Join Date: Jul 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

July 30th, 2003, 09:13 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: , , Australia.
Posts: 587
Thanks: 1
Thanked 1 Time in 1 Post
|
|
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.
======================================
|

July 31st, 2003, 11:30 AM
|
|
Registered User
|
|
Join Date: Jul 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for the help, didn't know about the double quote thing. I think I figured out what I'm missing.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |