我在文件夾Views-Department中有我的視圖'Create.cshtml'。我想使用名爲'_EnterpriseStructure.cshtml'的位於根目錄'CommonViews'中的部分視圖。 我使用的語法的RenderPartialHtml.RenderPartial - 渲染位於另一個文件夾中的部分視圖
@{Html.RenderPartial("~/CommonViews/_EnterpriseStructure.cshtml");}
局部視圖代碼
<div id="Client">
This is a Partial View.
</div>
執行時我收到System.InvalidOperationException。
詳細的錯誤是:
在 '〜/ CommonViews/_EnterpriseStructure.cshtml' 視圖必須從WebViewPage,或WebViewPage派生。
我使用ASP.Net MVC 5剃刀訪問量
[該視圖必須來自WebViewPage或WebViewPage。](http://stackoverflow.com/questions/8127462/the-view-must-derive-from-webviewpage-or-webviewpagetmodel) –
Dai