如上图(我从网上的截图)所示,不少状况下可能不须要一个渲染的页面,因此须要返回一个 .html 的页面,可是ASP.NET只识别渲染的页面,而不识别 .html 的页面。html
因此想返回的话用以下方法:spa
ASP.NET MVC3d
public ActionResult Index() { return new FilePathResult("~/content/index.html", "text/html"); }
ASP.NET Core MVCcode
public IActionResult Index() { return File("~/index.html", "text/html"); }