title: Dynamically created controls lose values
body: <p>ASP.NET 4.0.  I want to allow users to view/edit items on a customer's license.  A license has 1-M products, and the list of products will expand over time, so I'm dynamically creating a list of all products (in Page_Load) with a checkbox to say whether a license has that product, like this:</p>
  
  <pre><code>CheckBox cbxProduct = new CheckBox();
  cbxProduct.ID = "cbxProduct" + product.ID.ToString();
  </code></pre>
  
  <p>I can find those dynamic controls and access their values on PostBack using:</p>
  
  <pre><code>CheckBox cbxProd = (CheckBox)pnlLicenseDetails.FindControl("cbxProduct" + productID.ToString());
  </code></pre>
  
  <p>but only if they have just been re-created in Page_Load (or Page_Init, doesn't seem to matter).  The problem is that I want the user to be able to uncheck a box to remove a product from the license and then save the results.  But in order to find the checkbox and determine its value, I have to re-create the controls, which of course erases any value the user entered.</p>
  
  <p>If I try to reference the checkboxes without re-creating them, I of course get an "object reference not set..." error.  So I need some way to capture the values the user inputs before they are wiped out.  </p>
  
  <p>Suggestions?</p>