Rendering HTML in Multiline Textbox (or into any control for that matter)

asp.net

Solution

I assume you want to use a multiline textbox because of the scroll bar. You can achive this with a div.

<div style="width:300px;height:250px;overflow:auto;"></div>

Problem

I added some text to my multiline textbox. It's got some Html tags such as , , etc. How do I format this so that the text inside the multi-line textbox renders to the browser with the formatted HTML? Right now it's just rendering the plain text. some example text that was appended: ``` "<p class=""myclass"">blah blah blah some text</p>" ``` I tried this but it just renders the encoded values, doesn't render them as HTML: ``` txtSomeMultilineTextbox.Text = HttpUtility.HtmlEncode(someText.ToString()); ``` The purpose of this multiline textbox will be for a read-only Terms & Conditions box. I want formatted text in there such as bold, etc. I'm not interested in using a 3rd party control. Just want to figure out how to get this working.

Original source