title: ASP.NET RenderControl or RenderChildren fail
body: <p>I need to use objChildControl.RenderControl or objControl.RenderChildren to manually render my child controls. But it looks like these methods are incomplete.</p>
  
  <p>All my child controls use the OnPreRender event to register clientscript and client stylesheets (since these can only be created in the prerender event).</p>
  
  <p>I have 2 main issues, passing the current System.Web.UI.Page object to a child control and making sure the OnPreRender event is fired on these child controls.</p>
  
  <p>It seems that I can't use the RenderControl method on my child controls since the OnPreRender event will not be called.
  I can however pass the Page object by objChildControl.Page = Me.Page</p>
  
  <p>When I use RenderChildren I cannot pass the Page object, or can I?
  And i'm not sure if the OnPreRender event is even called when I use RenderChildren.</p>
  
  <p>Some help would be appreciated, since i'm stuck ;)</p>
  
  <p><strong>Update</strong></p>
  
  <p>I found a way to get the result I need, but it is not the solution I want.
  Example:</p>
  
  <p>Code I want:</p>
  
  <pre><code>&lt;wc:ParentControl id="objParent" runat="server" bla="etc"&gt;
  &lt;Content&gt; &lt;!-- This is an InnerProperty of the ParentControl --&gt;&lt;DIV&gt;bla bla bla bla.....&lt;wc:SomeControl id="objSomeControl" runat="server" /&gt;&lt;wc:3rdPartyControl id="obj3rdPartyControl" runat="server" /&gt;&lt;/DIV&gt;&lt;/Content&gt;
  &lt;/wc:ParentControl&gt;
  </code></pre>
  
  <p>CodeBehind: objParentControl.Content.RenderControl(Writer)</p>
  
  <p>And then the issues mentioned above will begin. How to make sure that for all the children within Content the OnPreRender will be called?</p>
  
  <p>Code which does work (but then the RenderControl method is just useless):</p>
  
  <pre><code>&lt;wc:ParentControl id="objParentControl" runat="server"&gt;&lt;/wc:ParentControl&gt;
  &lt;wc:Content id="objContent" runat="server"&gt;&lt;DIV&gt;bla bla bla bla.....&lt;wc:SomeControl id="objSomeControl" runat="server" /&gt;&lt;wc:3rdPartyControl id="obj3rdPartyControl" runat="server" /&gt;&lt;/DIV&gt;&lt;/wc:Content&gt;
  </code></pre>
  
  <p>Then just use the RenderBeginTag and RenderEndTag of the wc:Content control.
  Then the OnPreRender event is called.
  But I wan't to embed the content into the parentcontrol by using an InnerProperty.
  And then manually rendering the childcontrols by RenderControl or RenderChildren.</p>