How do I encode a complete URL string in ASP MVC

I get a url string and would like to transform it to a legal http url:

For example:

"http://one/two/three%four/five#five?six seven" should turn into "http://one/two/three%25four/five%23five?six%20seven"

However, HttpUtility.UrlEncode does not help, as it encodes the entire string (including the legal "://").

Thanks in advance

5
задан Daniel Peñalba 6 May 2011 в 14:10
поделиться