Redline textfield by error

hrk

New Member
In my app, I have a textfield which holds a value. When a user clicks the submit button and an invalid value is entered, an error message will be displayed:In my model:\[code\] [DisplayName("Lenght")] [Range(4, 64, ErrorMessage = "You are using a invalid length")] public int Length { get; set; }\[/code\]My view:\[code\] @Html.LabelFor(m => m.Length): @Html.TextBoxFor(m => m.Length) (4 - 64 chars) @Html.ValidationMessageFor(m => m.Length)\[/code\]I also want it so that the textfield is red-lined by an error.
 
Back
Top