在MVC 3几以后版本中,可以这样写:
ViewBag.Stuff = "<li>Menu</li>"
// 在视图中可以这样输出
@MvcHtmlString.Create(ViewBag.Stuff)
在MVC 3几以后版本中,可以这样写:
ViewBag.Stuff = "<li>Menu</li>"
// 在视图中可以这样输出
@MvcHtmlString.Create(ViewBag.Stuff)
转载于:https://www.cnblogs.com/AppleGold/p/4123752.html