If I do:
new Uri("http://www.example.com?name=i%20hate%20asp.net!").ToString()
it doesn’t return:
http://www.example.com?name=i%20hate%20asp.net!
it returns:
http://www.example.com?name=i hate asp.net!
Why? How do I make this work correctly?
You need to use
Uri.AbsoluteUri.ToString()is just a string representation of the underlying data, not a proper URI.