chobo2 chobo2 - 29 days ago 19
ASP.NET (C#) Question

HttpUtility.HtmlDecode not decoding spaces?

I have this

string test = HttpUtility.HtmlDecode("http://test.com/Folder1/Folder2/my%20view.aspx");


When I look into test it still has %20 instead of a space. Why is it not decoding this?

Answer

You are looking for HttpUtility.UrlDecode() (in the System.Web namespace, I think)