This code is from a form in my ASP.NET MVC application.
Using the code below, when the form field FirstName is blank, the error message is displayed in Red.
What do I need to do, to get the text box to have the red border and shaded background that is common on sites?
Thanks for any help on this.
Model class field:
[Required (ErrorMessage ="You must enter a first name")]
public string FirstName { get; set; }
Form field:
<div class="form-row">
<label for="FirstName" class="col-3 col-form-label">Number of users to process:</label>
@Html.TextBoxFor(m => m.FirstName, new { @class = "col-6 form-control" })
@Html.ValidationMessageFor(m => m.FirstName, null, new { @class = "text-danger" })
</div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…