Now, if you want to do the basic model validations like name and value for the display order on the
client side, it is pretty simple.
If you examine inside the shared folder, we have a validation script partial that is using to validate
it is inside a partial view.
So if we want to do client side validations, we just have to include this partial view in our view.
So that brings the big question, how do we use a partial view?
We have not created one, but we are using the one that is already available.
It's not a rule, but typically it's good to name partial views with underscore.
So even if in future, when we create a partial view, we they follow that convention.
Now, in order to include a partial view, it is pretty simple.
You can directly say a partial and then you have to write the name of the view, so make sure to type
the exact name.
If you have a spelling mistake there, then this won't be included.
With that, edits go away.
But inside the partial view, if you open up, we have script files, so we need to get inside a script
section five for you.
So here we will have to create a section for scripts.
And in there, we will have to add our partial view, and that too inside raises syntax.
Once you add this, let's run the application one more time and see the magic.
Let's go to our category and let's try to create a new category.
We will hit the Create button.
You see, we get the validations, but we are not going to server this time.
All the politicians are done on client side because of this group that we included.
To double check, you can just add a debugging point here and hit the reset button.
It will never reach our debugging point.
It will reach our debugging point.
If the need and display order are the same, then the client side validations are valid.
The validation that fails is the server side custom validation that we added.
And if you continue perfect, you can see that in action.
So with this, we can see how easy it was to add client side validation.
Let's continue in the next video.