RequiredIf not working in MVC 5?

Shmwel picture Shmwel · Oct 6, 2014 · Viewed 19k times · Source

I would like to know if there exists RequiredIf annotation in MVC 5 because I'm in trouble trying to use it because it seems that it doesn't exists in MVC 5. Is there any solution, or I'm missing some library? (I know it exists in MVC3).

Also is there any alternative for conditional validation in MVC 5?

Thanks in advance.

Answer

meda picture meda · Oct 6, 2014

Required if is not a built-in attribute. You need to download and import third party library:

MVC Foolproof Validation