Is it possible to set a css class in a TextBox html helper? This doesn't compile, obviously:
是否可以在TextBox html帮助器中设置css类?这显然不能编译:
<%=Html.TextBox("Region",Model.Region,new {class="Autocomplete"}) %>
Thanks.
谢谢。
1 个解决方案
#1
23
Class
is a reserved keyword, so you need to write it like this:
Class是保留关键字,因此您需要像这样编写它:
<%=Html.TextBox("Region", Model.Region, new { @class="Autocomplete" }) %>
#1
23
Class
is a reserved keyword, so you need to write it like this:
Class是保留关键字,因此您需要像这样编写它:
<%=Html.TextBox("Region", Model.Region, new { @class="Autocomplete" }) %>