title: HTML 'name' attribute generated for ASP.net child controls, instead of the unique 'ID' attribute
body: <p>The generated HTML code for my custom ASP.net server control generates the name attribute for child controls, instead of the id attribute. Something like this :</p>
  
  <pre><code>&lt;span id="GridView2_ctl02_editdis"&gt;
      &lt;input type="text" name="GridView2$ctl02$editdis$ctl00"/&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>The ID for the custom control itself is apparently proper.</p>
  
  <p>What is even stranger for me, is that the ID does get generated <em>sometimes</em> (I do not know under what conditions). But a <code>FindControl()</code> with that ID returns null on the server side. <code>FindControl()</code> with the value of the name attribute works just fine.</p>
  
  <p>Something like this :</p>
  
  <pre><code>&lt;span class="TextBox" id="GridView2_ctl02_editdis"&gt;
      &lt;input type="text" id="GridView2_ctl02_editdis_ctl00" name="GridView2$ctl02$editdis$ctl00"/&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>For the above, <code>FindControl("GridView2$ctl02$editdis$ctl00")</code> works fine, <code>FindControl("GridView2_ctl02_editdis_ctl00")</code> doesn't.</p>
  
  <p>How do I ensure consistent and predictable IDs?</p>