I just discovered that remote validation using the RemoteAttribute will not work unless either:
- The action method for the remote validation does not have an [ActionName] attribute, or
- The action method for the remote validation has an [ActionName] attribute that is a case-insensitive match for the actual action method name.
With the following, MVC throws an InvalidOperationException "No url for remote validation could be found.":
[ActionName("validate-my-widget")]
public virtual JsonResult ValidateMyWidget(string value1, string value2)
{
...
}
Any idea why? I am using T4MVC if that makes a difference.