Server.UrlEncode vs Uri.EscapeDataString

If any one will came across this in the future:

After some digging I have found out that Uri.EscapeDataString is the preferable option. See the the highest voted answer here and this post.

EDIT: Adding the information from the second link here:

We found that in some cases you need to consider using Uri.EscapeDataString. In our case we are encrypting the querystring and found that UrlDecode is converting a plus (+) to space. This was causing us errors during decryption. Using Uri’s Escape and UnescapeDataString makes sense for us when constructing a custom querystring in the URL.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)