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>