Solved

Passing & as a parameter value

Posted on 2004-08-16
7
291 Views
Last Modified: 2012-05-05
Is there a way of passing an & as a querystring value.

We are having a problem as obviously the & is used to seperate parameters but we need to pass one as part of a paramater.

2.asp?CoName=Alf & Burns
0
Comment
Question by:Kels
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 10

Expert Comment

by:Jay Toops
ID: 11811168
You must use the function urlencode("Alf & Burns")

example:

<%
response.write(Server.URLEncode("http://www.w3schools.com"))
%>Output:

http%3A%2F%2Fwww%2Ew3schools%2Ecom

special characters are meta-escaped using this
and are AUTOMATICALLY decoded by the server
so when you are processing this with your handler
you don't have to do anything else.

Jay
0
 
LVL 6

Accepted Solution

by:
philjones85 earned 125 total points
ID: 11811890
2.asp?CoName=Alf & Burns

place %26 in place of & and place %20 in place of spaces


string should be:

2.asp?CoName=Alf%20%26%20Burns
0
 
LVL 6

Expert Comment

by:philjones85
ID: 11811916
http://www.w3schools.com/html/html_ref_urlencode.asp

complete list of url encoded characters
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 35

Expert Comment

by:YZlat
ID: 11812130
try this:

strString = replace(strString,"&","&amp;")
0
 
LVL 35

Expert Comment

by:YZlat
ID: 11812346
also try

strString=replace( strString,"&","and")
0
 
LVL 13

Expert Comment

by:davidlars99
ID: 11814135
hi,
in javascript you'd do escape(2.asp?CoName=Alf & Burns)
and unescape()

cheers!
 dave
0
 
LVL 10

Expert Comment

by:Jay Toops
ID: 12078169
HI.. could you award points for this?
Id really appreciate it..

Jay
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn how to dynamically set the form action using jQuery.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question