Here is my razor code:
<fieldset>
<legend>Headline News</legend>
@foreach (var item in Model)
{
<div>@Html.DisplayFor(modelitem => item.Description)</div>
}
</fieldset>
The value for item.Description
is HTML:
<table border="0" cellpadding="2" cellspacing="7" style="vertical-align:top;"><tr><td width="80" align="center" valign="top">
{{ table info }}
</table>
I actually want to display the HTML content, but it shows up as HTML tags. Thanks in advance!
You should use:
@foreach (var item in Model)
{
<div>@Html.Raw(item.Description)</div>
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With