Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • blackhawk 313 posts 1368 karma points
    Feb 16, 2018 @ 20:48
    blackhawk
    0

    How to render special characters correctly on the front-end

    I have the following code in my razor view..

        var mcustomBrowserTitle = Model.Content.GetPropertyValue<string>("browserTitle");
    

    In Backoffice, I may put in a value like this into the RTE...

    Cats & Dogs
    

    ...But when it gets rendered in the browser tab on the front-end of the site, it appears like this...

    Cats &amp; Dogs
    

    What can I check or adjust, this way I can render special characters correctly on the front end.

  • Nicholas Westby 2054 posts 7104 karma points c-trib
    Feb 16, 2018 @ 21:51
    Nicholas Westby
    101

    According to the expert, this is the way to go:

    @Html.Raw(mcustomBrowserTitle)
    

    That will ensure the HTML gets output and doesn't get encoded.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies