How to make validation optional for a complex type in asp.net mvc? -


i want display editor type user. user contains field address of type address. made editor template type address reusable.

i don't want field address required creating user. fields required address, example country, state etc.

i want validate address if receive data it, if don't receive anything, don't want return validation error ui address. return validation errors user then.

what best way this?

thanks,

you might want custom model binder user type. way can choose override validation of address item inside user.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -