title: C# HtmlEncode, then Javascript insert using .innerHTML
body: <p>What follows is a piece of text that gets HtmlEncoded in C# before being sent to the browser (during a callback). Once received, in Javascript I do <code>myDiv.innerHTML = theStringBelow</code>;</p>
  
  <pre><code>&lt;span xmlns:asp="http://schemas.microsoft.com/ASPNET/20" 
        xmlns:SharePoint="Microsoft.Sharepoint.WebControls"
        xmlns:ext="my_namespace:my_xslt_extension"&gt;Some text to be shown.&lt;/span&gt;
  </code></pre>
  
  <p>However, what results is that I simply see the exact text shown above. It isn't being treated as an html element that got added to the DOM, but as plain text. When I add the exact same text through javascript (e.g., I skip the callback, and just say <code>myDiv="exactString</code>") it DOES get added correctly (it gets treated as a span). </p>
  
  <p>What is going on? Do I have to un-encode it? Should I not have encoded to begin with? </p>
  
  <p><strong>Edit</strong>
  The question still stands for curiosity's sake, but I have fixed the issue simply by not HtmlEncoding the data. An earlier issue must have added onto this one, making me think the HtmlEncoding was still necessary.</p>