I am working on a custom framework that doesn't allow me to use aspx pages to render controls. I am trying to find a way to render the HTML code using RenderControl, but I keep getting null reference errors. I've tried setting the directory and it doesn't work. If I attach the control to the current Page (instead of creating a new one), it renders properly. Unfortunately I cannot use that solution because as said, I don't have an aspx page to render onto; this framework uses Response.Write to generate the pages. Here is my code below: