What exactly is the difference between the two functions. The output seems similar except the Uri.EscapeUriString encodes spaces to %20 and Server.UrlEncode encodes them as a + sign.
And the final question which should be used preferably
What exactly is the difference between the two functions. The output seems similar except the Uri.EscapeUriString encodes spaces to %20 and Server.UrlEncode encodes them as a + sign.
And the final question which should be used preferably
I found that HttpUtility.UrlEncode is tolerant to null strings and long strings. It's available both in .NET Core and .NET Framework.