Say I have a dynamically generated LinkButton in my ascx.cs code-behind. How could I go about "printing" this control to my page? Obviously I can't do something like just print the Text property as I need the button to retain its hyperlink. I'm guessing I want to use the WebControl.Render method, but I'm not familiar with it at all and haven't been able to find a good example of its use.
You could provide a label at the right location in the page: <asp:Label id="myLinkButtonPlace" runat="server"></asp:Label>
, and in code, you could add the linkbutton to the controlcollection of the label: this.myLinkButtonPlace.Controls.Add(aLinkButton);
Following on from @Joachim VR, there are many other asp.net controls with which you can add a dynamically created control to.
<asp:Label id="Label1" runat="server" />
<asp:PlaceHolder id="Placeholder1" runat="server" />
<asp:Panel id="Panel1" runat="server" />
The above would render HTML different.
So the Label would render as a <span id="Label1"><a></a></span>
Panel as <div id="Placeholder1"><a></a></div>
The Placeholder would simply render as the <a></a>
This article http://www.tomot.de/article/3/asp.net/create-a-control-in-the-codebehind-and-retrieve-its-rendered-output should explain the basics of what you are looking for.