I am using UrlRewritingNet.UrlRewriter.dll for url rewriting purpose and frankly, I am new to this stuff. My problem is that , i want to replace %20 in my url with -.
3 Answers
HttpUtility.UrlDecode() does what you need.
2 Comments
Lou Franco
That would turn %20 into a space. The questioner is trying to turn them into - (dash).
If you need a custom replace apart that HttpUtility gives you (in this case it will convert it to space!) then just use string replacement.
Uri myuri = new Uri(myolduri.ToString().Replace("%20","-"));
1 Comment
Alexander Galkin
Wrap this transformation into a helper method and use it for binding.