Querystring Woes

  • Thread starter Thread starter Paul Marrero
  • Start date Start date
P

Paul Marrero

I have an ASP.NET web application that I have written. I just came across
this problem as I was loading more "real" data into the system and testing.
When I move from page to page, I use an argument and pick it up using a
Request.Querystring on the new page. The problem is, the data is encrypted
and therefore passes various characters in the argument. When it comes
across a plus sign (+), it doesn't know how to handle it.

For example, I have a link on page A that goes to Page B. The link may
something like:

http://localhostB.aspx?user=YX92Jw+usw928 <== Notice the + in the
argument

When page B loads, I do something like

dim x
x = request.querystring("user")

When I look at the results of x while debugging, I see YX92Jw usw928
<== Notice the plus sign is removed.

Are there ways around this? Cookies are not an option.

Thanks.
-Paul
 
That did it. Thanks.


M. Posseth said:
This behavior is by design + & % signs are so called special chars + =
' ' ( space )
you can avoid this behavior with URLENCODE and URLDECODE

or external coding / decoding like ROT13

M. Posseth [MCP]



Paul Marrero said:
I have an ASP.NET web application that I have written. I just came across
this problem as I was loading more "real" data into the system and testing.
When I move from page to page, I use an argument and pick it up using a
Request.Querystring on the new page. The problem is, the data is encrypted
and therefore passes various characters in the argument. When it comes
across a plus sign (+), it doesn't know how to handle it.

For example, I have a link on page A that goes to Page B. The link may
something like:

http://localhostB.aspx?user=YX92Jw+usw928 <== Notice the + in the
argument

When page B loads, I do something like

dim x
x = request.querystring("user")

When I look at the results of x while debugging, I see YX92Jw usw928
<== Notice the plus sign is removed.

Are there ways around this? Cookies are not an option.

Thanks.
-Paul
 
This behavior is by design + & % signs are so called special chars + =
' ' ( space )
you can avoid this behavior with URLENCODE and URLDECODE

or external coding / decoding like ROT13

M. Posseth [MCP]
 
Back
Top