Use the HtmlTextWriter.WriteEncodedText(string) method when a string contains angle brackets (< or >) or an ampersand (&).
The HtmlTextWriter.WriteEncodedText(string) method uses the System.Web.HttpUtility.HtmlEncode(string, System.IO.TextWriter) method to perform the encoding and also converts Unicode character 00A0 to .