public static string EncodeURL(string URL) { try { return HttpUtility.UrlEncode(URL).Replace("+","%20"); } catch { string msg = "Unable to encode URL: " + URL; throw new ArgumentException(msg); } }