I'm creating my own ModelValidator inheritor. I'm essentially performing a "Required" check on properties based upon a property of the container. This worked out beautifully in the override of Validate(object container). However, GetClientValidationRules gives me no such "container" parameter/feature. How can I determine the container from inside the GetClientValidationRules override? The callstack shows that GetClientValidationRules is called as part of my call: Html.ValidationMessageFor(f=>f.Field). I need "f.IsRequired" to determine whether or not to send the client-side rule. Or can the rule be disabled on the client side with some other parameter for ValidationMessageFor?
View Complete Post