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

  • Thread starter Thread starter Guest
  • Start date Start date
.... 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
 
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
 
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.
 
Back
Top