Copied to clipboard

Flag this post as spam?

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


  • Sher 42 posts 62 karma points
    Dec 02, 2011 @ 13:12
    Sher
    0

    Html Shown as Text

    Hi All,

    I am new to razor so this might be a very simple problem, i am getting a property from another page which is returning me raw html, if i put the value in my htmlk at runtime through razor script then it is shown as text.

    my code is as belows, Thanks in advance.

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @{
        var ourFurniture = @Model.Children.Where("Visible");
        foreach (var item in ourFurniture)
        {  
            var previewText = item.GetProperty("previewText");
            <div class="rcLvl3Div1" style="background-color: #f5f2ef; margin-left: 15px; margin-top: 20px;">
                    <div style="float: left; margin-left: 10px; margin-top: 10px; width: 200px;">                   
                           @previewText.Value                   
                    </div>
            </div>
        }         
    }

     

    @Preview.Value Has this value:

    <div><span class="text-Trebuchet-14-brownish">Bed Queen Size</span></div>
    <div>
    <p style="margin-bottom: 5px;" class="text-Trebuchet-12-brownish">Vestibulum eu ipsum. Duis porttitor velit ac massa.Cras sit amet neque. Sed massa felis, semper quis, ullamcorper sit amet, aliquam id, turpis. Vestibulum nisl. Ut a pede in dui rhoncus tincidunt. Duis sed sem.</p>
    </div>
    <div><span class="text-Trebuchet-14-brownish">Save upto £406!</span></div>

  • Sher 42 posts 62 karma points
    Dec 02, 2011 @ 13:16
    Sher
    0

    Found Ths Solution,

    @Html.Raw("Text")

Please Sign in or register to post replies

Write your reply to:

Draft