public class MyValidator : IValidate
{
public IEnumerable Validate(MyPage instance)
{
if (...)
{
yield return new ValidationError
{
ErrorMessage = "My message",
PropertyName = "MyProperty",
Severity = ValidationErrorSeverity.Error,
ValidationType = ValidationErrorType.Unspecified
};
}
}
}
Everything works fine, I cannot publish the page, I get "My message" in validation summary, etc. But how can I mark MyProperty as invalid (red border and error message next to it)?
Do I have to use a custom attribute on top of MyProperty?
Hi,
I have created the following page validator:
Everything works fine, I cannot publish the page, I get "My message" in validation summary, etc.
But how can I mark MyProperty as invalid (red border and error message next to it)?
Do I have to use a custom attribute on top of MyProperty?
Episerver 9.8.
Thanks!