End of line in Notification message

2 posts, 0 answers
  1. pharmadev
    pharmadev avatar
    7 posts
    Member since:
    Dec 2012

    Posted 04 Dec 2016 Link to this post



    My notification is

     @foreach (SLEmailMessage x in Model.Notifications)
    subject = '@x.Subject';
    body = '@x.Body';
                               @: notification.show({ title: subject, message:
    body }, "upload-success");


    In my controller

    Where @x.Body =  "Building = 101" + Environment.NewLine +
                                 "Manager Name: " + "Ali Baba";

    The Environment.NewLine is causing an error. How to add a "end on line" in the notification?

    I tried to replace the "end on line" by the <br> tag within a paragraph and it dit not work

    A quick answer will be greatly appreciated






  2. Slav
    Slav avatar
    1359 posts

    Posted 07 Dec 2016 Link to this post


    You can use a separate field for the data that should be displayed on a new line and add the br element in the template.

    Let me know if this approach is an option or you need to specify it when constructing the body of the message.

    Telerik by Progress
    Telerik UI for ASP.NET MVC is ready for Visual Studio 2017 RC! Learn more.
Back to Top