title: How to specify ID for an Html.LabelFor<> (MVC Razor)
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3065307/client-id-for-property-asp-net-mvc">Client Id for Property (ASP.Net MVC)</a>  </p>
  </blockquote>
  
  
  
  <p>Is there a way to make Razor render an ID attribute for a Label element when using the Html.LabelFor&lt;> helper?</p>
  
  <p>Example:</p>
  
  <pre><code>.cshtml page
  @using (Html.BeginForm())
  {
  @Html.LabelFor(m =&gt; m.Foo)
  @Html.TextBoxFor(m =&gt; m.Foo)
  }
  </code></pre>
  
  <p>Rendered page</p>
  
  <pre><code>&lt;form ...&gt;
  &lt;label for="Foo" id="Label_Foo" /&gt;
  &lt;input type="text" name="Foo" id="Foo" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>FYI - The sole reason I'm wanting to add an ID to the Label is for CSS design. I'd prefer to reference the Label by an ID rather than wrapping the Label within a block (i.e. div) and then styling the block.</p>