Recently I received client requirements for validation Component fields using Event System. I am facing issue in message with multiple lines.

throw new Exception(“Experience must <br> be greater <br> than 10”);

The <br> tag is not working in the Tridion GUI message.

looking for solutions and ideas.

enter image description here


You would have to make CSS updates through a GUI extension besides using the new line (\n) in your exception message.

  • In your event system exception, you will be using the new line like this:

    throw new Exception("Some text before new line.\nSome text after new line.");

  • In the GUI extension, set the CSS white-space property to pre-wrap in the div element of the notification message.

    white-space: pre-wrap;

enter image description here

| improve this answer | |

Assuming it's C# .NET, you can try using the Environment.NewLine property from the System namespace. NewLine actually equals \r\n.

String.Format("NewLine: {0}  first line{0}  second line{0}  third line",
| improve this answer | |

Did you try xhtml line break


| improve this answer | |
  • I tried and not worked <br/> tag. – Sudhakar Rao Jan 23 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.