How does one add an "id" attribute to Html.LabelFor() in ASP.NET MVC2?
- by MartinK
How would one add an "id" attribute to Html.LabelFor() in ASP.NET MVC2?
This is my label code:
<%=Html.LabelFor(x => x.FirstName)%>
This is my failed attempt:
<%=Html.LabelFor(x => x.FirstName, new { @id = "first-name" } )%>
Thanks.