liveBook · Manning

jQuery Validation

As explained in Pro ASP.NET Core 7, Tenth Edition

jQuery Validation is a JavaScript library that validates form input in web pages.

jQuery Validation performs browser-side form validation in ASP.NET Core applications. It gives users immediate feedback before data reaches the server and prevents submission while validation errors remain. section 29.6

ASP.NET Core form tag helpers emit data-val* attributes describing field constraints. The unobtrusive validation library reads those attributes and configures jQuery Validation, separating rules from JavaScript code. section 29.6

A minimal setup installs and loads the validation scripts in order:

  • Install jquery-validate@1.19.5 and jquery-validation-unobtrusive@4.0.0 with LibMan. section 29.6
  • Load jQuery, jquery.validate.min.js, and jquery.validate.unobtrusive.min.js in _Validation.cshtml. section 29.6
Listing 29.23 Installing the validation packages
libman install jquery-validate@1.19.5 -d wwwroot/lib/jquery-validate
libman install jquery-validation-unobtrusive@4.0.0
   -d wwwroot/lib/jquery-validation-unobtrusive

Use the package-installation listing for the exact LibMan commands. section 29.6

How Pro ASP.NET Core 7, Tenth Edition covers it

How deep it goes
Explains package installation, script ordering, generated attributes, and submission behavior without detailing the library’s internal algorithms.
Examples
Uses Name-field data-val attributes, LibMan commands, and a shared _Validation.cshtml script partial.
What it assumes
Assumes an ASP.NET Core form and basic JavaScript asset setup, while explaining the validation package and attribute wiring.
What you can do after
Apply it via ASP.NET Core’s unobtrusive validation pipeline to block invalid form submission in the browser.
How it connects
Connects JavaScript, ASP.NET Core form tag helpers, unobtrusive validation, and server-side model validation.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Pro ASP.NET Core 7, Tenth Edition. The section links point to the parts of the book it draws on.