.NET MVC3中输出Html标签

控制器:

ViewBag.Message = "< h 1 >欢迎使用 ASP.NET MVC!< / h 1>";

视图:


@Html.Raw(ViewBag.Message)

@MvcHtmlString.Create(ViewBag.Message)

@{WriteLiteral(ViewBag.Message);}

@(new HtmlString(ViewBag.Message))