How can I override the IsValid property?
I have a model that’s validating as false. I have a custom ValidationAttribute on the model and I’d like to set the IsValid flag for the whole model under certain circumstances.
Is this possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can implement IDataErrorInfo on your model and apply model-wide validation.
This page has some information about iplementing the IDataErrorInfo Interface, about 2/3 of the way down under the heading “mplementing the IDataErrorInfo Interface”