ASP.Net URLEncode Ampersand for use in Query String

The documentation suggests that Server.UrlEncode should handle ampersands correctly.

I’ve just tested your exact code and the returned string was correctly encoded:

http://www.example.com/?Value=This+%26+That

Leave a Comment