473,383 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Query string in asp page

In asp how How can i pass a parameter value with a space in the value

like this

test.asp?catalog=aValue&lineitem=ladies cloths

I get a %20 as a space in the browser window,
Regards
Don
Jul 19 '05 #1
4 10892
Don,

Usually the %20 doesn't cause problems for me, but if you have to keep the
space, you might try:

<%
query = request.querystring("query")
query = Replace(query, "%20", " ")
response.write query
%>
<a href="test.asp?query=my name">Click me</a>

The replace function here removes any '%20' it finds and replaces it with a
space

Hope this helps.

Gram
Jul 19 '05 #2
Gram wrote:
[snip replace function]
The replace function here removes any '%20' it finds and replaces it with a
space


This won't work due to the nature of the HTTP standard (should be
somewhere within RFC 2616).
Because a http query string cannot contain spaces within a request
(blanks are userd as separators f.ex. "GET index.html") they are being
replaced by your browser automatically. Therefore some kind of
server-sided replace function will not work - and even should not work.
However, your webserver knows about this and replaces all %20 with
spaces so you can access your variables again with spaces instead of %20.

This does affect other special characteres as well. There is a
server-function that you can use to encrypt a string before processing
your document to the client: Server.HTMLencode (SomeString)

Jul 19 '05 #3
Or Server.URLEncode(SomeString)

Ray at home

"Kai Boenke" <ka********@de.bosch.com> wrote in message
news:bm**********@ns2.fe.internet.bosch.com...
Gram wrote:
[snip replace function]
The replace function here removes any '%20' it finds and replaces it with a space


This won't work due to the nature of the HTTP standard (should be
somewhere within RFC 2616).
Because a http query string cannot contain spaces within a request
(blanks are userd as separators f.ex. "GET index.html") they are being
replaced by your browser automatically. Therefore some kind of
server-sided replace function will not work - and even should not work.
However, your webserver knows about this and replaces all %20 with
spaces so you can access your variables again with spaces instead of %20.

This does affect other special characteres as well. There is a
server-function that you can use to encrypt a string before processing
your document to the client: Server.HTMLencode (SomeString)

Jul 19 '05 #4
Ray at <%=sLocation%> wrote:
Or Server.URLEncode(SomeString)

"Kai Boenke" <ka********@de.bosch.com> wrote in message
news:bm**********@ns2.fe.internet.bosch.com...
[snip other stuff]
This does affect other special characteres as well. There is a
server-function that you can use to encrypt a string before processing
your document to the client: Server.HTMLencode (SomeString)


You are right.
"Server.HTMLencode (SomeString)" actually does something different (not
completely but useless in this case): Converting characters to HTML
entities.

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says...
2
by: Andy | last post by:
I haven't done any web work for over a year and for the life of me I cannot remember how to use a query string in a URL. I want the link to be page.aspx?ID=1 then pass 1 into a query like this ...
3
by: Dr. Oz | last post by:
Hi, I am trying to read in a query string from one page and build a link to another page based on the query string. Here's the code I am using to read in the query string: <script...
10
by: Onur Bozkurt | last post by:
I'am sending some data by the querystring. But I don't want it to be seen exactly because of security reasons. Is there a way to encrypt it and later decrypt when reading the querystring...? I...
3
by: Jim Lewis | last post by:
I have read several things that state accessing a Web Service through a Query String should work. However, when I try to execute http://localhost/webservice1/service1.asmx/HelloWorld I get the...
8
by: Jim in Arizona | last post by:
I've been using an example out of a book to be able to edit the rows in a database. I am getting the following error: ========================================================...
1
by: TF | last post by:
This group came through for me last time so here we go again. My page shows paint colors, brand name, product code, etc in a gridview with the background matching the paint color. Several links on...
0
by: =?Utf-8?B?SnVsaWEgQg==?= | last post by:
Hi all, I've got a search result web page that is populated dependant on data in the query string. It works fine. However if the user navigates away from the search results page, then...
5
by: =?Utf-8?B?SnVsaWEgQg==?= | last post by:
Hi, I posted last week about a problem I've got and didn't get any responses, but I've managed to come up with a workaround and a possible cause (guessing). I was wondering if someone could...
4
by: zion4ever | last post by:
Hello good people, Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.