还有其他方法可以从控制器返回原始html吗?与仅使用Viewbag相反。如下所示:
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.HtmlOutput = "<HTML></HTML>";
return View();
}
}
@{
ViewBag.Title = "Index";
}
@Html.Raw(ViewBag.HtmlOutput)