Is it possible to use 2 remote validation attributes on a single property in a view model?
What I would like to be able to do is perform 2 checks, first that a given user id exists in the DB and second that the user has not already set up an account on the system.
I guess I could always make a custom attribute which has both tests in it, but if possible I would prefer to just use the out of the box functionality and chain the validations together.
I cant really combine the logic together into a single JsonResult, as I need to have different error messages depending on how the validation fails, and AFAIK its not possible to return the error message with the validation result?
Actually, you can return a distinctive error message using MVC3 remote validation. See, for example, http://msdn.microsoft.com/en-us/library/gg508808(v=vs.98).aspx or http://deanhume.com/Home/BlogPost/mvc-3-and-remote-validation/51.