Link to home
Start Free TrialLog in
Avatar of sbornstein2
sbornstein2

asked on

MVC validation question

Hello all,

I have the following in my model a class:

  public class PatientSearchModel
    {
        //Patient Info
        public string MemberId { get; set; }
        public string PatientLastName { get; set; }
        public string PatientFirstName { get; set; }
        public string PatientDob { get; set; }
    }

Open in new window


I need to add validation that the user has to have either MemberId OR Last, First and Dob.  How can I add the attributes for this check.  Not sure if I use ValidationMessageFor after this as well.

Thanks for any help.
ASKER CERTIFIED SOLUTION
Avatar of Easwaran Paramasivam
Easwaran Paramasivam
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sbornstein2
sbornstein2

ASKER

thanks