When you use the InnerHtml property of a
HtmlTextArea
control on the server side to prevent
automatic encoding that is performed with ASP.NET, the InnerHtml property does not prevent the encoding of special characters to
HTML entities. For example, when the InnerHtml property is set to <b>Hello</b>, the angle bracket characters (< and >) are converted to
< and > respectively, and the text displayed on the page is <b> Hello </b>.
When you use the InnerText property of a HtmlTextArea control on the server side to provide
automatic HTML encoding, the InnerText property does not encode special characters to HTML entities. For
example, when the InnerText property is set to <b>Hello</b>, the angle bracket characters (< and >) are not converted to
< and > respectively. Because of this, the browser detects the <b> tags
and displays the text "Hello" in bold type.
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.