Intendi questa?
https://docs.microsoft.com/it-it/dotnet/api/system.web.httputility.htmlencode?view=netframework-4.8