Basically, what the title says. I have several properties that combine together to really make one logical answer, and i would like to run a server-side validation code (that i write) which take these multiple fields into account and hook up to only one validation output/error message that users see on the webpage.
I looked at scott guthries method of extending an attribute and using it in yoru dataannotations declarations, but, as i can see, there is no way to declare a dataannotations-style attribute on multiple properties, and you can only place the declarations (such as [Email], [Range], [Required]) over one property :(.
any ideas on how to go about this? preferably without having to go the whole AssociateValidatorProvider route? as i found thisdifficult to grasp mainly since people never tell you 'why' they are doing what they are doing in enough detail to make me feel comfortable.
at the moment, i've tried ot create a dummy hidden field on the form with the [Required] attribute on it, and i set it to an empty string when my multi-field custom validation code predicts an error, which shoudl trigger an error message, but not even that works, because when i change the values of these fields AFTER the action is received, the modelstate isn't updated with this info so presumes submitted values, and doing an UpdateModel fails with an error. on top of these errors, i suppose it isn't the elegant way to do things. so i'm listening to anything you guys suggest.