1
我有我測試了與此相關的實驗材料項目:.NET MVC - Controller/View and physical path?目錄瀏覽,而不是顯示視圖
現在我無法顯示正常的MVC觀點:
在http://mvc4testsomething/Folder/Index
,顯示視圖。 在http://mvc4testsomething/Folder/
,我得到 「HTTP錯誤403.14 - 禁止訪問」 錯誤。
以下是當前所有路線: routes.IgnoreRoute(「{resource} .axd/{* pathInfo}」);
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
routes.MapRoute(
"Folder",
"Folder/{action}/{id}",
new { controller = "Folder", action = "Index", id = UrlParameter.Optional }
);
web.config
有:
<directoryBrowse enabled="false" showFlags="Date, Time, Size, Extension" />
如果我改變directoryBrowse
在web.config
true
,它只是顯示該文件夾的內容,而不是視圖。
比你的幫助。
默認路徑之前移動文件夾路徑。 – Nilesh
謝謝,但這並沒有改變任何東西。 – TTT
你見過MVC中的區域是如何工作的嗎?我想你需要那樣的東西。 – Nilesh