473,473 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Request.QueryString and Server.URLDecode()

Does Server.URLDecode() need to be applied to Request.QueryString(<key
name>) ?
Nov 19 '05 #1
6 11975
"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in news:OVxu7q5nFHA.4056
@TK2MSFTNGP10.phx.gbl:
Does Server.URLDecode() need to be applied to Request.QueryString(<key
name>) ?


Yes - if the string is encoded. Request.Querystring returns the raw
(undecoded) text.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #2
Yes, as I discovered this is also important when using Base64-encoded
strings in the QueryString. Here's what I use to combat frustration:

string sOKForBase64Decrypt =
Server.UrlDecode(Request.QueryString["argument"].ToString()).Replace("
","+")

-- Sean M

"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:OV**************@TK2MSFTNGP10.phx.gbl...
Does Server.URLDecode() need to be applied to Request.QueryString(<key
name>) ?

Nov 19 '05 #3
Hmmm ...

My tests don't show any need to apply Server.URLDecode() to
Request.QueryString()

I tested a return URL of

http://localhost/Results.aspx?search...re+some+spaces

Debug-mode stepping through the server-side code ,
Request.QueryString("search") contains the value "here are some spaces" (no
plus signs are included)



"Sean M" <ta******@hotmail.com> wrote in message
news:O4**************@TK2MSFTNGP09.phx.gbl...
Yes, as I discovered this is also important when using Base64-encoded
strings in the QueryString. Here's what I use to combat frustration:

string sOKForBase64Decrypt =
Server.UrlDecode(Request.QueryString["argument"].ToString()).Replace("
","+")

-- Sean M

"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:OV**************@TK2MSFTNGP10.phx.gbl...
Does Server.URLDecode() need to be applied to Request.QueryString(<key
name>) ?


Nov 19 '05 #4
Lucas Tam wrote:
"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in
news:OVxu7q5nFHA.4056 @TK2MSFTNGP10.phx.gbl:
Does Server.URLDecode() need to be applied to
Request.QueryString(<key name>) ?


Yes - if the string is encoded. Request.Querystring returns the raw
(undecoded) text.


Um... no. Items retrieved from the QueryString collection have already
been decoded (anything else would be disastrous).

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #5
"Joerg Jooss" <ne********@joergjooss.de> wrote in news:xn0e643z6a3rc8n004
@msnews.microsoft.com:
Yes - if the string is encoded. Request.Querystring returns the raw
(undecoded) text.


Um... no. Items retrieved from the QueryString collection have already
been decoded (anything else would be disastrous).


Oops you're right : )

Always thought you needed to run it through Server.URLDecode.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #6
"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in news:ueSagefoFHA.3256
@tk2msftngp13.phx.gbl:
Hmmm ...

My tests don't show any need to apply Server.URLDecode() to
Request.QueryString()


I think it may of been out of habit from ASP days???

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #7

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

Similar topics

4
by: Max | last post by:
Hello. This is the first time I've posted to a newsgroup, and I do this because I'm in desperate need of help. I'm working a user management system, and when I activate a user that has registered...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
3
by: Axel Dahmen | last post by:
Hi, I've created an aspx page taking a query string argument as parameter. Although I've correctly escaped umlauts in the query string, they do not appear in the QueryString collection. If I...
7
by: SevDer | last post by:
Hi I have a class library that needs to download the HTML in a specific page of ours with provided querystring. When I open this URL with any browser, it loads fine. When I do WebRequest from Web...
1
by: EoRaptor013 | last post by:
Not sure where to ask this question, but... I'm using a TreeView component to enable browsing file folders in a specific directory (for test purposes /Program Files/). Some users use an ampersand...
2
by: ffrugone | last post by:
I need to pass a querystring parameter that contains the relative path and querystring of another page. For example: ...
3
by: Tom | last post by:
Trying to build a querystring using Attributes.Add: return_ok.Attributes.Add("value", "http://mydomain.com/finish.aspx?finish=324234" + @"&email=raerwe@fred.com" + @"&verify=32423dasdf3"); ...
3
by: Bob | last post by:
Hi, i want to pass the date/time from one page to another page like this: firts page: --------- <asp:HyperLink ID="HyperLink1" NavigateUrl="mypage.aspx?dat= & 'date.now'"...
2
by: Doogie | last post by:
Hi, I'm writing Javascript code to parse out a query string. I want to handle the case where a parameter value may not be sent. So consider a parameter called "State". If the user doesn't pass...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.