Client Side validation in ASP NET MVC 5 (Part - 21)

Опубликовано: 20 Февраль 2026
на канале: Syed Ali
785
3

Here we will learn client-side validation in ASP.NET MVC 5: let us see : --

1) Create a new project with empty and selection of MVC AND WEB-API
2) Create a model student model and write their properties which ever is required
3) Create a controller a homeController
4) Add a view against the home controller and write code in index method and index with post methods
5) Create a bundle class file to add a JS library into it and name the single name jqueryval to add it into layout page.
a. jquery-1.10.2.js
b. jquery.validate.js
c. jquery.validate.unobtrusive.js


6) write a CSS for error
7) in web configure file enable the ClientValidationEnabled and UnobtrusiveJavaScriptEnabled
8) run the project.