Dynamic control creation
<p>I read about the dynamic control creation in ASP.NET this piece of text:</p>

<blockquote>
  <p>...When using dynamic controls, you
  must remember that they will exist
  only until the next postback. ASP.NET
  will not re-create a dynamically added
  control. If you need to re-create a
  control multiple times, you should
  perform the control creation in the
  Page.Load event handler. This has the
  additional benefit of allowing you to
  use view state with your dynamic
  control. Even though view state is
  normally restored before the Page.Load
  event, if you create a control in the
  handler for the Page.Load event,
  <strong>ASP.NET will apply any view state
  information that it has after the
  Page.Load event handler ends. This
  process is automatic</strong> ...</p>
</blockquote>

<p>I wanted to try it on example
create a button declaratively -   </p>

<pre><code>&lt;asp:Button ID="Button1" runat="server" Text="Button" 
             onclick="Button1_Click"  /&gt;
</code></pre>

<p>and dynamically on behind code 5 checkboxes -  </p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
  for (int i = 0; i &lt;= 5; i++)
    {
      var chBox = new HtmlInputCheckBox();
      Controls.Add(chBox);
    }

}
</code></pre>

<p>But when i check some checkboxes and hit the button, after postback all checkboxes
states are erased. It mean ASP.NET does not manage view states of dynamic controls
automatically? I tried to enable view state to each of checkbox and for whole page, 
but its doesn't work.
Can someone explain:
1. Why is it so?
2. How to avoid this?</p>
