How to show html content in a textfield as text value no html rendering

  1. #1

    How to show html content in a textfield as text value no html rendering

    I'm loading some text to a textfield, the text is html , so it renders as if it is a html page.
    So if the text value is like below, it shows a div instead of showing this:

    <div class="nav-main">
    						<ul>
    						        <li><a href="/" title="Home">Home</a></li>
    							<li><a href="/examples/" title="Examples">Examples</a></li>							
    
    						</ul>
    How can I prevent this from happening?

    Thanks
    Last edited by geoffrey.mcgill; Feb 22, 2011 at 5:19 AM.
  2. #2

    RE: How to show html content in a textfield as text value no html rendering

    I'm using this for now

    protected string EscapeHTML(string HTML){
                HTML=HTML.Replace("<", "&amp;lt;");
                HTML=HTML.Replace(">", "&amp;rt;");
                return HTML;
            }
    Is there property or anything like that for Ext. controls so that HTML value won't be rendered as HTML
    Last edited by geoffrey.mcgill; Feb 22, 2011 at 5:19 AM.

Similar Threads

  1. Replies: 1
    Last Post: May 29, 2012, 8:08 PM
  2. [CLOSED] Rendering html in a user control
    By fordprefect in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 14, 2012, 7:42 PM
  3. How to content <%=Html.TextArea()%>
    By qch2006qch in forum 1.x Help
    Replies: 0
    Last Post: Jan 19, 2012, 2:54 AM
  4. [CLOSED] html tag in text content breaks app
    By jwf in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: May 18, 2011, 6:17 PM
  5. Replies: 3
    Last Post: Mar 01, 2010, 4:55 AM

Posting Permissions