How to disable MVC 4 model validation?

asp.net-mvc, c#, model-validation

Solution

I don't know it this could work but did you try this (bootstrap code or global.asax)

ModelValidatorProviders.Providers.Clear();

Problem

I am working on a project written on mvc 4 that got several instances of wizard-like behaviour - chain of few views that pass the same half-filled model. Starting from the second view controls are initially shown as non-valid (which is logical - model, passed to controller method has corresponding properties empty). Currently `ModelState.Clear();` solution is used, but putting it into each method with model as an argument looks ugly. Same with approach found here Disable Model Validation in Asp.Net MVC ``` ModelBinders.Binders[typeof(MyModelType)] = new NonValidatingModelBinder(); ``` Project got too many (over 100) model classes to register each one manually. Is there simpler way (maybe key in .config) that turns off model validation completely?

Original source

Related problems