Dynamic user controls null, but cannot create them during page_init
<p>I have a winforms based website.</p>

<p>This site has a page that contains a repeater.</p>

<p>The repeater contains a number of items, each of which contains a number instances of a user control.</p>

<p>The number of instances varies for each item in the repeater.</p>

<p>Normally, if I was dynamically creating a usercontrol, I would do so in The page_init method so that all its data was then available during postbacks and so on.</p>

<p>However, Until the repeater item has been created, I do not know how many instances of this user control I will need.</p>

<p>So, how do I get round this issue? I need to create these user controls in page_init to have them available, but I do not know how many there will be until it binds.</p>

<p>The only way I can see is to double handle the data, and in page init, create a Dictionary&lt;,List>, and then use this in the DataItem_Bind and DataItem_Create methods. But this seems inefficient.</p>

<p>Is there a more elegant way of managing this issue?</p>
