Writes the specified markup attribute and value to the output stream, and, if specified, writes the value encoded.
Use the HtmlTextWriter.WriteAttribute(string, string, bool) method to write markup attributes and their values with or without encoding. The HtmlTextWriter.WriteAttribute(string, string, bool) method uses the System.Web.HttpUtility.HtmlAttributeEncode(string, System.IO.TextWriter) method to do the encoding.
The HtmlTextWriter.WriteAttribute(string, string, bool) method writes the attribute value enclosed in double quotation marks ("). If value is null, the HtmlTextWriter.WriteAttribute(string, string, bool) method writes only the attribute name.