0
我有以下這種結構的ASP .NET MVC3(剃刀)網站:Howto:嵌套佈局的區域?
Site1
-Areas
-Area1
-Views
-SomeFeature
-Index.cshtml --> sets the section 'pageScripts'
-Shared
-_Layout.cshtml --> has Layout = ~/Views/Shared_Layout.cshtml, sets the section 'layoutScripts'
-Viewstart.cshtml ---> has Layout = ~/Areas/Area1/Views/Shared/_Layout.cshtml
-Area2
-Views
-Shared
-Views
-Shared
-_Layout.cshtml ---> has optional sections pageScripts, layoutScripts
這裏是我的問題:
當我嘗試訪問equivalient控制方法~/Area1/SomeFeature/Index
,我得到一個異常消息說
The following sections have been defined but have not been rendered for the layout page "~/Areas/Area1/Views/Shared/_Layout.cshtml": "pageScripts".
我有定義爲
部分 「pageScripts」@RenderSection("pageScripts", false) in ~/Views/Shared_Layout.cshtml
爲什麼我試圖做到這一點:
此刻,我發現自己不得不在區域1(區域2和)每個視圖佈局屬性設置爲~/Views/Shared/_Layout.cshtml
是否有一個知道我在做什麼錯了?
- 感謝您的任何建議