System.Web.HttpException: The file ~/xxx//Index.cshtml cannot be requested directly because it cal
生活随笔
收集整理的這篇文章主要介紹了
System.Web.HttpException: The file ~/xxx//Index.cshtml cannot be requested directly because it cal
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
剛開始用Razor的時候經常把RenderSection當作RenderPartial的替代品,其實它是ContentHolder的替代品。
Section的意圖是在上級頁面(原來的master)中建立一個空間,在子級頁面中向其中根據需要填充內容。因此不能在被直接調用的子頁面(如index)中直接寫RenderSetion,而只能寫@section。
因此直接訪問帶有RenderSection的頁面,相當于直接調用master。
?
點擊下載免費的敏捷開發教材:《火星人敏捷開發手冊》
?
轉載于:https://www.cnblogs.com/wodeyitian/archive/2011/03/12/2460062.html
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的System.Web.HttpException: The file ~/xxx//Index.cshtml cannot be requested directly because it cal的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 投靠Linux第一步 Windows数据
- 下一篇: C++程序员必读的经典著作