У меня есть следующий помощник HTML MVC 5 Razor:
@Html.TextBoxFor(m => m.ShortName,
new { @class = "form-control", @placeholder = "short name"})
Мне нужно, чтобы это поле было необходимо (т.е. иметь красный контур, когда пользователь переходит, не помещая значение inn). В HTML 5 WebForms я мог бы просто сказать <input type="text" required />
, чтобы иметь этот эффект.
Каков правильный синтаксис для выполнения этого в синтаксисе Razor?