Try our conversational search powered by Generative AI!

How to display a list of validation messages?



I am trying to pass a list of error messages to CancelReason property of ConventEvent class, and display each message in its own

  • , but I can't figure out how to achieve this.

    Anyone has a solution for this?



    Mar 22, 2016 4:32

    Implement multiple validators? :)

    Mar 22, 2016 9:20

    Hi Daniel

    Thanks for your reply. 

    How multiple validators could be used to fix this problem? The CancelReason only accepts a string value

    Can you provide a code sample?

    Mar 22, 2016 10:40

    Hello Vincent

    You could consider considering implementing an IValidator<T> interface rather than use the content events. This allows you to return a collection of messages. See


    Mar 22, 2016 12:49

    I meant using validators like David also suggested. How many depends on your view on single responsibility principle :)

    Haven't tried to use multiple validators myself on the same content type though. My validation is pretty small so no need to split it up. But in theory you could validate vs an interface like IHasSeoInformation or similar.

    Edited, Mar 22, 2016 17:22
    * 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.