How do I replace all the spaces with %20 in C#?
Another way of doing this is using Uri.EscapeUriString(stringToEscape)
.
I believe you're looking for HttpServerUtility.UrlEncode.
System.Web.HttpUtility.UrlEncode(string url)
I found useful System.Web.HttpUtility.UrlPathEncode(string str);
It replaces spaces with %20 and not with +.