I have a custom message which is the return type of the remote validation method, when the return type was Boolean it was working fine, but now when I changed the return type then I'am getting input-validation-error class in the input field but no error message is displayed.(I have error messages written). i don't know what is causing to add that class in the input field.
Remote Validation
[Remote("Checkmail", "api", ErrorMessage = "Already taken")]
public string Email { get; set; }
Method that is being called
public Message Checkmail(string email)
{
try
{
if(email=="test@test.com")
{
return new Message{MessageCode = "True"};
}
return new Message{MessageCode= "false"};
}
catch (Exception)
{
throw;
}
}
AJAX call
$(document).ajaxComplete(function (event, xhr, settings) {
var status = xhr.responseJSON;
if (status.MessageCode == "True") {
//CSS to change
}