OK - this isn't perfect, but here is how I got around it.
First a created a "dummy" user control (lets call it UCDummy) that only contained the form tag and the control I "really" wanted to render the output of.
The reason I did this is because sometimes I use the "real" usercontrol on my website and if I were to keep the form tag on it, it would give me an error saying there are too many form tags on the page.
For example - this code is within the "dummy" user control:
Code:
<asp:form runat="server">
... THE USER CONTROL HERE
</asp:form>
Then on the page where I want to render the html (in my case I put it in the database for later use), I do the following:
Code:
StringBuilder SB = new StringBuilder();
StringWriter SW = new StringWriter(SB);
HtmlTextWriter htmlTW = new HtmlTextWriter(SW);
UCDummy.Visible = true;
UCDummy.RenderControl(htmlTW);
WhereEverIWantItToGo = SB.ToString();
UCDummy.Visible = false;
Now I have the best of both worlds. It does necessitate an extra file, but sometimes it doesn't need to be pretty, it just needs to work.
Hope this helps!