November Happy Hour will be moved to Thursday December 5th.

IValidate and properties

Vote:
 

Hi,

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.

Thanks!

#147737
Apr 22, 2016 12:51
Vote:
 

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

#147742
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.