Try our conversational search powered by Generative AI!

IValidate and properties



I have created the following page validator:

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?

Episerver 9.8.


Apr 22, 2016 12:51

As far as I know the IValidate interface does server side validation only - so no red border

Apr 22, 2016 13:56
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.