Reputation: 25739
Is it possible to set a css class in a TextBox html helper? This doesn't compile, obviously:
<%=Html.TextBox("Region",Model.Region,new {class="Autocomplete"}) %>
Thanks.
Upvotes: 13
Views: 13347
Reputation: 26408
Class
is a reserved keyword, so you need to write it like this:
<%=Html.TextBox("Region", Model.Region, new { @class="Autocomplete" }) %>
Upvotes: 23