Follow the code below:
View:
<div class="form-group">
@Html.LabelFor(m => m.Telefone, new { @class = "font-weight-bold" })
@Html.TextBoxFor(m => m.Telefone, new { @class = "form-control", @placeholder = "Digite seu telefone" })
@Html.ValidationMessageFor(m => m.Telefone, "", new { @class = "text-danger" })
</div>
Here is an example of the bootstrap v4: link
They use the class is-invalid
and is-valid
. How do I do this in Razor?