Search code examples
jqueryasp.netrazorunobtrusive-validation

.NET Core with jquery.validate.unobtrusive: error messages are missing


I am using jquery.validate.unobtrusive with .NET Core to do client-side validation. I see the form validation is working (upon error the input is turning red ...) but I do not see the error messages. I think error messages should be visible, at least that's I have seen sofar link1 link2

enter image description here

I have already done:

  1. import scripts for jquery.validate.js and jquery.validate.unobtrusive.js

  2. ClientValidationEnabled = true

  3. Added System.ComponentModel.DataAnnotations validation attributes

I cannot post the whole code so this the repository


Solution

  • I was missing the following in razer:

    @Html.ValidationMessageFor(m => m.Username)