Michael Edwards
Michael Edwards

Reputation: 6518

ASP.NET MVC 3 Stop Validation

I have a Razor view with multiple buttons. I only want validation to occur when the user clicks one of these buttons.

How do I stop or clear validation of fields in the controller?

Upvotes: 1

Views: 3388

Answers (1)

jgauffin
jgauffin

Reputation: 101150

  1. To disable client side validation:

    Disable client-side validation in MVC 3 "cancel" submit button

  2. To disable server side validation:

    Asp.net MVC ModelState.Clear

Upvotes: 1

Related Questions