title: How to use the <label> tag in ASP.NET?
body: <p>How can I use the <code>&lt;label&gt;</code> tag within an ASP.NET application? I want it to be valid, accessible, and usable.</p>
  
  <p>I understand the optimal HTML way is this:</p>
  
  <pre><code>&lt;label for="Username"&gt;Username:&lt;/label&gt;
  &lt;input type="text" id="Username" runat="server" /&gt;
  </code></pre>
  
  <p>But if the above code is in an ASP.NET user control, the input ID will change, meaning the label's "for" attribute is useless. I could make the label tag a server control and set its "for" attribute in the code (<code>Username.ClientID</code>), but it seems like a lot of work for such a simple thing.</p>
  
  <p>I've also seen this HTML used in the past:</p>
  
  <pre><code>&lt;label&gt;
      &lt;span&gt;Username&lt;/span&gt;
      &lt;input type="text" id="Username" runat="server" /&gt;
  &lt;/label&gt;
  </code></pre>
  
  <p>What is the proper approach?</p>