In previous release (RC1) I have used the interface IClientModelValidator to validate/compare the Password and Confirm Password using 'ModelClientValidationEqualToRule' class as follows
public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ClientModelValidationContext context)
{
String strMsg = AccessLocalization.GetString(_resourceID);
var modelClientValidationEqualToRule = new ModelClientValidationEqualToRule(strMsg, _OtherPropertyName);
yield return modelClientValidationEqualToRule;
}
and in jQuery
$.validator.addMethod("equalto",
function (value, element, parameters) {
return value;
});
$.validator.unobtrusive.adapters.add('equalto', [], function (options) {
options.rules.equalto = {};
options.messages['equalto'] = options.message;
});
However, now I am using .Net Core 1.0 where this interface is completely changed and it does not have 'ModelClientValidationEqualToRule' class available.
After reading the documentation I came to know the validation will be done with the help of data-attributes. So, far I have achieved that for required field attribute, range field attribute, email address attribute etc.
But, I am not getting clear idea how can I validate Password and Confirm Password ?
Any help on this appreciated !