我想在我的主視圖中呈現局部視圖。但是,我得到的錯誤:我的觀點的未找到MVC PartialView
The partial view 'CompletedJobParts' was not found or no view engine supports the searched locations. ~/Views/Jobs/CompletedJobParts.aspx ~/Views/Jobs/CompletedJobParts.ascx ~/Views/Shared/CompletedJobParts.aspx ~/Views/Shared/CompletedJobParts.ascx ~/Views/Jobs/CompletedJobParts.cshtml ~/Views/Jobs/CompletedJobParts.vbhtml ~/Views/Shared/CompletedJobParts.cshtml ~/Views/Shared/CompletedJobParts.vbhtml
(抱歉格式)...
物理佈局(位置)是 查看/ MDT /工作/ CompletedJobParts.cshtml和我m試圖從同一位置的視圖調用它(即Views/MDT/Jobs/Index.cshtml)。我想這可能是一個路由問題,所以我進入:
routes.MapRoute(
"MDT",
"MDT/{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
到我的Global.asax.cs文件,但它似乎並沒有搜索有兩種(即沒有MDT節中的位置上來它正在尋找)。
我使用這index.cshtml內作出:
<div id="parts_div">
@{Html.RenderPartial("CompletedJobParts", Model);}
</div>
什麼我需要做的就是我的視角以尋找我的PartialView?
TIA
謝謝。完美工作。 – Jason 2012-02-02 05:42:17
也適合我。試圖添加一個新的局部視圖來修改佈局。萬分感謝!! – Kaos 2013-02-09 19:46:35