title: Is it possible to use a common remote validation check in ASP.NET MVC?
body: <p>To hvae remote validation you do the following in your view model:</p>
  
  <pre><code>public class ViewModelOne {
     [Required]
     [Remote("CheckStringIsRed", "RemoteValidationController", ErrorMessage = "It's not red.")]
     public string BgColour { get; set; }
  }
  </code></pre>
  
  <p>and then have an action in a controller somewhere:</p>
  
  <pre><code>public JsonResult CheckStringIsRed(string BgColour) {
      return Json(BgColour == "Red");
  }
  </code></pre>
  
  <p>but say I want to perform the same validation elsewhere so:</p>
  
  <pre><code>public class ViewModelOne {
      [Required]
      [Remote("CheckStringIsRed", "RemoteValidationController", ErrorMessage = "It's not red.")]
      public string SomeColour { get; set; }
  }
  </code></pre>
  
  <p>Note how the property name is now <strong>SomeColour</strong> which means the call to the orginal CheckStringIsRed() will fail. So is there any way to reuse CheckStringIsRed() considering that the parameter names are different? I only want to write the validation once and use it on may properties.</p>