我想使用純HTML頁面而不是使用MVC .net的cshtml . 但是當我通過右鍵單擊索引添加視圖時,我只能看到兩個選項 .
public class HomeController : Controller
{
//
// GET: /Home/
public ActionResult Index()
{
return View();
}}
Cshtml(剃刀)
Aspx
論壇但仍無濟于事 . 我仍然沒有看到添加html而不是cshtml的選項
我也嘗試直接添加html頁面到視圖文件夾,但我不知道如何從我的控制器功能指向該視圖 .
用Index.html替換Index.cshtml給了我這個錯誤
The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/Home/Index.cshtml
~/Views/Home/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml