我有一个SQL表,其中包含显示文本的HTML格式.
<strong>What Is EDI ?</strong><p>EDI is a method for communicating electronically with trading partners based upon standards.</p>
在我的MVC应用程序中,有一个index.cshtml页面如下:
<h2>Index</h2>
<table>
<tr>
<th> @Html.DisplayNameFor(model => model.Body)</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>@Html.DisplayFor(modelItem => item.Body)</td>
</tr>
}
</table>
Run Code Online (Sandbox Code Playgroud)
问题是文本显示为正常,没有HTML格式.任何人都可以帮助解决我遇到的问题吗?