title: Convert IHtmlContent/TagBuilder to string in C#
body: <p>I am using ASP.NET 5. I need to convert IHtmlContent to String</p>
  
  <p><code>IIHtmlContent</code> is part of the <code>ASP.NET 5</code> <code>Microsoft.AspNet.Html.Abstractions</code> namespace and is an interface that <code>TagBuilder</code> implements</p>
  
  <p>Simplified I have the following method</p>
  
  <pre><code>public static IHtmlContent GetContent()
  {
      return new HtmlString("&lt;tag&gt;blah&lt;/tag&gt;");
  }
  </code></pre>
  
  <p>When I reference it </p>
  
  <pre><code>string output = GetContent().ToString();
  </code></pre>
  
  <p>I get the following output for GetContent()</p>
  
  <pre><code>"Microsoft.AspNet.Mvc.Rendering.TagBuilder" 
  </code></pre>
  
  <p>and not </p>
  
  <pre><code>&lt;tag&gt;blah&lt;/tag&gt;
  </code></pre>
  
  <p>which I want</p>
  
  <p>I also tried using StringBuilder</p>
  
  <pre><code>StringBuilder html = new StringBuilder();
  html.Append(GetContent());
  </code></pre>
  
  <p>but it also appends the same namespace and not the string value</p>
  
  <p>I tried to cast it to TagBuilder</p>
  
  <pre><code>TagBuilder content = (TagBuilder)GetContent();
  </code></pre>
  
  <p>but TagBuilder doesn't have a method that converts to string</p>
  
  <p>How do I convert IHtmlContent or TagBuilder to a string?</p>