BUG: InnerText and InnerHTML Encoding Does Not Work as Expected (815186)
The information in this article applies to:
- Microsoft ASP.NET (included with the .NET Framework) 1.0
- Microsoft ASP.NET (included with the Windows .NET Framework 1.1)
SYMPTOMSWhen 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.STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
REFERENCESFor more information about the InnerHtml property, visit the following MSDN Web site:
Modification Type: | Minor | Last Reviewed: | 4/30/2003 |
---|
Keywords: | kbhtml kbCtrl kbControl kbWebForms kbBug KB815186 kbAudDeveloper |
---|
|