title: Literal control not displaying rendered HTML
body: <p>I am storing HTML in a database and trying to render it on a page using a literal control. The problem is that the literal is not rendering the code and is instead just displaying the markup on the web page. I have checked the HTML and it works fine when added directly to the page but does not work when set as the literals text property.</p>
  
  <p>I have done this many times before, in face I have re-used the code but for some reason only the markup is showing.</p>
  
  <p>Literal on page:</p>
  
  <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"&gt;
  
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentArea" Runat="Server"&gt;
      &lt;asp:Literal ID="Literal1" runat="server" Mode="PassThrough"&gt;&lt;/asp:Literal&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>VB Code:</p>
  
  <pre><code>   Private Sub LoadContent()
  
          Dim strConnectionString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
  
          Dim conn As SqlConnection = New SqlConnection
  
          conn.ConnectionString = ConfigurationManager _
                  .ConnectionStrings("ConnectionString").ConnectionString
  
          Dim cmd As SqlCommand = New SqlCommand
  
          cmd.CommandText = ("select HTML from Pages where " &amp; _
                             "PageName like @SearchText + '%'")
  
          cmd.Parameters.AddWithValue("@SearchText", "TheShop")
          cmd.Connection = conn
          Dim sb As StringBuilder = New StringBuilder
          conn.Open()
          Dim sdr As SqlDataReader = cmd.ExecuteReader
          While sdr.Read
              sb.Append(sdr("HTML")) _
                  .Append(Environment.NewLine)
          End While
          conn.Close()
          Literal1.Text = sb.ToString
  
  
      End Sub
  </code></pre>
  
  <p>This is the contents of sb.ToString before it is added to the literal:</p>
  
  <pre><code>&amp;lt;p&amp;gt;&amp;lt;span style="color:#FF0000"&amp;gt;revergveraer&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
  
  &amp;lt;p&amp;gt;&amp;lt;span style="color:#FF0000"&amp;gt;&amp;lt;img alt="" src="http://pngimg.com/upload/fish_PNG1156.png" style="height:133px; width:200px" /&amp;gt;rgergerg&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;
  </code></pre>
  
  <p>This is the HTML that is output and shown as markup by the literal:</p>
  
  <pre><code>&lt;p&gt;&lt;span style="color:#FF0000"&gt;revergveraer&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#FF0000"&gt;&lt;img alt="" src="http://pngimg.com/upload/fish_PNG1156.png" style="height:133px; width:200px" /&gt;rgergerg&lt;/span&gt;&lt;/p&gt;
  </code></pre>