title: How to make a textbox accept html tags
body: <p>I have a textbox in my aspx page. The user wants to have the ability to input html tags in the textbox. The only way so far I know to by pass the validation error is set the ValidateRequest to false. I tried couple of other ways:
  (1) using Server.HtmlEncode in a javascript like this</p>
  
  <pre><code>&lt;%@ Import Namespace="System.Web" %&gt;
  
          var tb = document.getElementById("&lt;%=synopsisTextBox.ClientID%&gt;");
          var value =Server.HtmlEncode(tb.value);
  </code></pre>
  
  <p>But I got compiler error. Can anyone tell me what I did wrong?</p>
  
  <p>(2) creating my own encode function</p>
  
  <pre><code>function escapeHTML (str) 
  { 
     var div = document.createElement('div'); 
     var text = document.createTextNode(str); 
     div.appendChild(text); 
     return div.innerHTML; 
  }
  </code></pre>
  
  <p>somehow it didn't work quite well. When I click some button that causes postback in the same page, it gets stuck. </p>
  
  <p>Can anyone tell me if there is a better way to make your textbox accept html tags? Thanks.</p>