Hi Guys,
Im having a challenge using the Unobtrusive Validation and i created two classes one validatin a set of rule and another one a set of a rule.
i invoke them using this technique...
[ValidationRuleX(ErrorMessageResourceName = "WSEARCH_VALIDATION_WILL_XRULE",
ErrorMessageResourceType = typeof(SanlamTrust.Localisation.strings))
]
[ValidationRuleDigit(ErrorMessageResourceName = "WSEARCH_VALIDATION_WILL_DIGITRULE",
ErrorMessageResourceType = typeof(SanlamTrust.Localisation.strings))
]
public string WillNumber { get; set; }
They are both validating the same control which is WillNumber....
The implementation of both classes header look like this
public class ValidationRuleDigitAttribute : ValidationAttribute, IClientValidatable{}
public class ValidationRuleXAttribute : ValidationAttribute, IClientValidatable{}
When i execute the program is returns this error:
Validation type names in unobtrusive client validation rules must be unique.
I checked in most site with people who have encountered this and they advice for a creation of other property in your like this:
public ModelClientValidationNotEqualToRule(string errorMessage, string otherProperties)
{
ErrorMessage = errorMessage;
ValidationType = "willnumber";
ValidationParameters.Add("otherproperties", otherProperties);
}
In my case im using only one field not multiple fields...
Thanx in advance
Mninawa