Consider the following valid razor HTML helper code:
@Html.TextBoxFor(m => m.Name, new { @class = "form-control", placeholder="Select..." })
However, there are some libraries that I'm using, that uses hyphenated attributes such as this:
<select class="form-control select2me" data-placeholder="Select...">
When I try to do this:
@Html.TextBoxFor(m => m.Name, new { @class = "form-control", data-placeholder="Select..." })
I get this error:
Invalid anonymous type member declarator. Anonymous type members must be declared with a member assignment, simple name or member access.
How can I use hyphenated attributes in razor synax?