Can I disable DataAnnotations validation on DefaultModelBinder?

Posted by Max Toro on Stack Overflow See other posts from Stack Overflow or by Max Toro
Published on 2010-03-16T21:49:03Z Indexed on 2010/03/16 21:51 UTC
Read the original article Hit count: 600

I want DefaultModelBinder not to perform any validation based on DataAnnotations metadata. I'm already using DataAnnotations with DynamicData for the admin area of my site, and I need a different set of validation rules for the MVC based front-end.

I'm decorating my classes with the MetadataType attribute. If I could have different MetadataType classes for the same model but used on different scenarios that would be great. If not I'm fine with just disabling the validation on the DefaultModelBinder, either by setting some property or by creating a specialized version of it.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc