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.
<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>
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>
Found Ths Solution,
@Html.Raw("Text")
is working on a reply...