title: Programmatically rendering a web UserControl
body: <p>I have a load of <code>UserControl</code> objects (<code>ascx</code> files) in their own little project. I then reference this project in two projects: The REST API (which is a class library project) and the main website.</p>
  
  <p>I'm sure this would be easy in the website, simply use <code>Controls.Add</code> in any <code>Panel</code> or ASP.NET control would work.</p>
  
  <p>However, what about the API? Is there any way I can render the HTML of this control, simply by knowing the type of the control? The <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.control.rendercontrol.aspx" rel="noreferrer">RenderControl</a> method doesn't write any HTML to the writer as the control's life cycle hasn't even started.</p>
  
  <p><em>Please bare in mind that I don't have the controls in the web project, so I don't have a virtual path to the <code>ascx</code> file. So the <a href="http://msdn.microsoft.com/en-us/library/t9ecy7tf.aspx" rel="noreferrer">LoadControl</a> method won't work here.</em></p>
  
  <p>All the controls actually derive from the same base control. Is there anything I can do from within this base class that will allow me to load the control from a completely new instance?</p>