title: Use ASP.Net server control code generation from .ashx
body: <p>I'm trying to take an existing bunch of code that was previously on a full .aspx page, and do the same stuff in a .ashx handler.</p>
  
  <p>The code created an HtmlTable object, added rows and cells to those rows, then added that html table the .aspx's controls collection, then added it to a div that was already on the page.</p>
  
  <p>I am trying to keep the code in tact but instead of putting the control into a div, actually generate the html and I'll return that in a big chunk of text that can be called via AJAX client-side.</p>
  
  <p>HtmlTable errors out when I try to use the InnerHtml property (says it isn't supported), and when I try RenderControl, after making first a TextWriter and next an HtmlTextWriter object, I get the error that Page cannot be null.</p>
  
  <p>Has anyone done this before?  Any suggestions?</p>