Disable Client Side validation on a button click – ASP.NET MVC

ASP.NET MVC we use client side validation using jQuery.validate plugin, which will be based on Model – Data Annotation validation attributes.

In some cases we might want to disable such validation on a button click wherever it is not needed.

For example:

The below code block will register validation block for Title property in the Model, will result in client side validations fired when user click on button.

We can disable the client side validation check for a button using the “disableValidation=true” attribute for the button.

OR

OR

You disable client-side validation on a button by adding the css style class “cancel” to it.

That will look like below example:

These are the different ways you can disable the client side validations. Hope it was helpful.

Other times, you're doing some piece of work and suddenly you get feedback that tells you that you have touched something that is very alive in the cosmos. Share your feedback on this blog, it will help me improve it a lot..