title: How to resolve " a control with id X could not be located or a different control is assigned to the same ID after post back" in asp.net?
body: <p>Please help me to rectify this error.</p>
  
  <blockquote>
    <p>An error has occurred because a control with id 'ctl81' could not be
    located or a different control is assigned to the same ID after post
    back. If the ID is not assigned, explicitly set the ID property of
    controls that raise post back events to avoid this error</p>
  </blockquote>
  
  <p>This error occurred on a post back by an asp button click. All the controls in the page were dynamically generated. I tried to find this control in the page source but in vain.</p>
  
  <pre><code>    HtmlGenericControl td1 = new HtmlGenericControl("td");
      TextBox txt1 = new TextBox();
      txt1.ID = "toqty"+i.Tostring();
      td.controls.add(txt1);
      placeholder.controls.add(td);
  </code></pre>