For attribute="value" I use
@Html.TextBoxFor(x => x.Email, new { type = "email", @class = "form-control",
placeholder="Email address" })
it gives me:
<input class="form-control" id="Email" name="Email" placeholder="Email address"
type="email" value="" />
How can I add single attribute to that, so I need required and autofocus:
<input class="form-control" id="Email" name="Email" placeholder="Email address"
type="email" value="" required autofocus />
Thanks!
new { required = "required" }? As far as I know that would be the only way to do it. That won't give you exactly the markup you want but it'll still work.