about escaped Query string

A

Anders Both

If I receive a query string on the server that contains escaped char´s like
this:

text=%20asadfdsf%20%C6%D8%C5%20%E6%F8%E5%20AAA

How can I then get the NameValueCollection where the escaped value´s are not
exchanged (unescaped).

If i do like this Request.QueryString["text"] I dont get the content that
you see above, but the server try's to exchange the % stuff into something
else.

Best Regards
 
C

Cowboy \(Gregory A. Beamer\)

Off the top of my head, I would look at URLDecode in the HttpServerUtility
or HttpUtility class (have not tested, but this would flow well with
traditional ASP methods).

NOTE: There is also an HTML decode method in the HttpServerUtility to decode
characters like > (>), et al.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
M

mikeb

Anders said:
If I receive a query string on the server that contains escaped char´s like
this:

text=%20asadfdsf%20%C6%D8%C5%20%E6%F8%E5%20AAA

How can I then get the NameValueCollection where the escaped value´s are not
exchanged (unescaped).

If i do like this Request.QueryString["text"] I dont get the content that
you see above, but the server try's to exchange the % stuff into something
else.

Best Regards

Request.Url.Query will get you the raw query string, but you'll have to
parse out all the parameters yourself - not too difficult a task.
 
A

Anders Both

thx, this is what i will do.

Best Regards

mikeb said:
Anders said:
If I receive a query string on the server that contains escaped char´s like
this:

text=%20asadfdsf%20%C6%D8%C5%20%E6%F8%E5%20AAA

How can I then get the NameValueCollection where the escaped value´s are not
exchanged (unescaped).

If i do like this Request.QueryString["text"] I dont get the content that
you see above, but the server try's to exchange the % stuff into something
else.

Best Regards

Request.Url.Query will get you the raw query string, but you'll have to
parse out all the parameters yourself - not too difficult a task.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top