Malformed URL by using Page.Request.Url.ToString() - why?

G

Guest

.... second question is obsolete as OriginalUri And PathAndQuery do the job.
Still why does ToString() return an invalid URI? Is this by intention?

TIA,
Axel Dahmen
 
M

Mythran

Axel Dahmen said:
... second question is obsolete as OriginalUri And PathAndQuery do the
job.
Still why does ToString() return an invalid URI? Is this by intention?

TIA,
Axel Dahmen

I believe it's because the URL contains another full URL with QueryString
arguments and the URL parser may be getting confused because it sees = in
the 2nd query string....if you can modify the query string to use URLEncode,
that should help. (Encode the querystring before sending the request ... or
set the URLEncode'ed string for the link you are using....)

HTH,
Mythrna
 
W

Walter Wang [MSFT]

Hi Axel,

The querystring of the URL is encoded using HttpUtility.UrlEncode. When
Uri.ToString() is called, internally it will decode the URL back to its
normal format. Yes it's by design behavior.

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top