title: ASP.NET Get table html
body: <p>I have a table on my ASP.net page something like this:</p>
  
  <pre><code>&lt;table runat="server" id="resultsTable"&gt;&lt;/table&gt;
  </code></pre>
  
  <p>I dynamically add content to the table, and it works just fine. However, I want to get the HTML of the table once I've added the dynamic content, i.e. something like this (formatting isn't important, I've just added it)</p>
  
  <pre><code>&lt;table runat="server" id="resultsTable"&gt;
    &lt;tr&gt;
      &lt;td&gt;Hello!&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Goodbye!&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I need the result as a string. Obviously I could do some looping and build my own table with the data, but I'd prefer to not do that if at all possible.</p>