ASP.NET MVC empowers you with the ability to validate user input both on client and server sides.
Client-side validation is performed on the client's browser and allows you to immediately show/hide error messages according to the user input validity. The client-side validation validates the form before it is submitted: if the form is not valid, it won't be submitted.
Server-side validation occurs when a form is submitted to the server. Server-side validation allows you to protect your web application from malicious end-users who can bypass client-side validation.
The code sample below demonstrates how to validate a model class instance on the server side before adding it to the database (if you use model validation or unobtrusive client validation approaches).
The AddNewClient(...) action method uses a ModelStateDictionary.IsValid property value to ensure that the model instance has no validation errors. A valid model class instance can be safely added to the database.