Attention! This is a translation of the ASP.NET MVC issue. Adding Attribute “data-message” to Html.TextBoxFor
It is necessary to display an additional data attribute in the form element:
<input name="file" type="file" class="file" data-show-preview="false"> How to do this with a strongly typed helper? The following option does not work:
@Html.TextBoxFor(x => x.File, new { type = "file", data-show-preview = "false", @class = "file" }) I get an error:
Invalid anonymous type member declarator. Anonymous type members must be declared a member