title: Get the HTML rendered by ASP.NET control in Code behind
body: <p>Hi I want to call the corresponding html inside a Panel in code behind. How can I do that?</p>
  
  <p>I have this</p>
  
  <pre><code>&lt;asp:Panel ID="MyPanel" runat="server"&gt;
      // other asp.net controls and html stuffs here.
  &lt;/asp:Panel&gt;
  </code></pre>
  
  <p>I want to get the HTML equivalent of <code>MyPanel</code> and all of its contents in my code behind say in PageLoad or some methods.</p>
  
  <p>Thanks.</p>