C# .Net How to Encode URL space with %20 instead of +
C#.Netasp.net MvcWebC# Problem Overview
How to encode query string space with %20
instead of +
?
Because System.Web HttpUtility.UrlEncode()
gives the space with +
.
C# Solutions
Solution 1 - C#
https://msdn.microsoft.com/en-us/library/system.uri.escapeuristring(v=vs.110).aspx
var encoded = Uri.EscapeUriString("How to encode");
OUTPUT:
How%20to%20encode