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.



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.

Leave a Reply

Your email address will not be published. Required fields are marked *