Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    May 15, 2012 @ 16:07
    Fuji Kusaka
    0

    Cant get html to work in a @helper

    Hi all,

    Am trying to get a <strong> and <br/> in a @Helper but it doesnt to work. 

    Any suggestion on how to get this?? 

    @Message("Logged in : " +  <strong>userName</stronguserLogin.getProperty("fullName").Value.ToString())

    //fuji

  • Tom Fulton 2030 posts 4998 karma points c-trib
    May 15, 2012 @ 16:17
    Tom Fulton
    1

    Hi Fuji,

    In your helper method try accepting an HtmlString instead of a string, or use Html.Raw to output it

    Method 1 - change the "string" to "HtmlString"

    @helper Message(HtmlString yourMessage)

    Method 2 - output the message wrapped in @Html.Raw instead of just the message

    @helper Message(string yourMessage) {
      @Html.Raw(yourMessage)

    HTH,
    Tom 

  • Fuji Kusaka 2203 posts 4220 karma points
    May 16, 2012 @ 07:22
    Fuji Kusaka
    0

    Hey Tom, 

    The second method worked well for me. 

    Thanks

    fuji

Please Sign in or register to post replies

Write your reply to:

Draft