Top Categories
Part 12 - Server Side and Client Side Validation in ASP.NET MVC
- Category: Information Technology
- Sub Category: Web Development
Hello everyone, Here in this video I have just explained that how can you apply server side and Client side validation in Asp.net MVC.
SOCIAL :
Like TechnoTips official Page : http://facebook.com/technotipstutorial
Subscribe : http://youtube.com/user/aapkanigam
GET CODE here:
http://technotip
Hello everyone, Here in this video I have just explained that how can you apply server side and Client side validation in Asp.net MVC.
SOCIAL :
Like TechnoTips official Page : http://facebook.com/technotipstutorial
Subscribe : http://youtube.com/user/aapkanigam
GET CODE here:
http://technotipstutorial.blogspot.in/2016/11/part-12-server-side-and-client-side.html
INTRODUCTION :
First thing is that why do we use validation?
Suppose the user does not enter any thing and submit the form then definitely the null value will be saved in our database or it will give an exception due to not nullable foreign key .
Apply a server side validation is very simple .
Just go to your view model and write [Required] then right click on it and resolve it .Resolve means your actually adding reference to the data annotation library.
The for displaying message ,go to your page and use Html.ValidationMessageFor() helper
Final step is to create the overload method of index because if we submit form from index then it should come back to same page with invalid model.
Applying Client side validation is also simple .You just need to add three references to your page
1. Jquery
2. Jquery unrobustive js
3. Jquery validator plug js
Now you r done with client side validation
RECOMMENDATION :
I strongly suggest you to watch these videos in order to consolidate your knowledge .
Watch MODEL VIEW ,CONTROLLER and DATABASE Connection Video :
1. MODEL : Part 4- https://www.youtube.com/watch?v=yeUDYcvPF3A
2. VIEW :Part 3- https://www.youtube.com/watch?v=Pt2UoRFuT-Y
3. CONTROLLER :Part 2- https://www.youtube.com/watch?v=g2GbL4hPOMg
4.Database connection : Part 6 :https://www.youtube.com/watch?v=UrHKfCCncHQ
TAGS :
how to create a - website
asp. net mvc
asp.net mvc interview questions
asp .net mvc tutorial
asp. net mvc 4
asp.net mvc 5 tutorial
asp net mvc developer
asp net mvc continuous integration
asp net mvc hosting
model view controller
jquery-ajax
$ ajax jquery
jquery ajax tutorial
viewbag
$controller
$model
razor view engine
$how to get rich