Solved

Passing & as a parameter value

Posted on 2004-08-16
7
289 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Remove lines by logo 2 30
Accurate Analytics (Not Google) 2 41
Remove third quote mark from widget 6 23
move expression web site to a new server 13 34
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

777 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