Having problem calling the remote validation. I have everything setting properly with the matching property name with argument in the remoting methods in my controller. Only thing I suspect was the model which I located in a separate project.
This is my code of the model:
[Display(Name="First name")]
[Required(ErrorMessage="First name required")]
public string Firstname { get; set; }
[Display(Name = "Last name")]
[Required(ErrorMessage = "Last name required")]
public string Lastname { get; set; }
[Display(Name = "Username")]
[Required(ErrorMessage = "Username required")]
[Remote("IsUsernameExisted", "UserValidationController", HttpMethod = "POST")]
public string Username { get; set; }
[Display(Name = "Email address")]
[Required(ErrorMessage = "Email address required")]
[Remote("IsEmailExisted", "UserValidationController", HttpMethod = "POST")]
public string EmailAddress { get; set; }
[Display(Name = "Password")]
[Required(ErrorMessage = "Password required")]
public string Password { get; set; }
[Display(Name = "Confirmation password")]
[Required(ErrorMessage = "Confirmation required")]
[System.Web.Mvc.CompareAttribute("Password", ErrorMessage = "Passwords don't match.")]
public string ConfirmationPassword { get; set; }
This model is a separate project but in same solution in visual studio.
Will it the reason the remote validation not get fired.
Might be this missing in your web.config?
"Because no JavaScript is emitted when you use unobtrusive client validation, if you forget to include the validation scripts, you will not see any errors when the page loads. The only result is that the form values will not be validated in the browser."
Source: How to: Implement Remote Validation in ASP.NET MVC