Controller 后台
截图:
代码:
public ActionResult myhome()
{
ViewBag.Message = "<div style='color:red;'>关注我了解更多</div>";
return View();
}
myhome.cshtml 页面
截图:
代码:
<div class="container">
导入失败,请严格按照模板格式!!!<br />
错误原因:
@Html.Raw(HttpUtility.HtmlDecode(ViewBag.Message))
</div>