Server Error in '/' Application.

The file "~/teaching/teaching-layout.cshtml" cannot be requested directly because it calls the "RenderBody" method.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The file "~/teaching/teaching-layout.cshtml" cannot be requested directly because it calls the "RenderBody" method.

Source Error:


Line 24: 
Line 25: <div id="content">
Line 26: 	@RenderBody()
Line 27: </div>
Line 28: 

Source File: d:\Websites\jackzheng.net\teaching\teaching-layout.cshtml    Line: 26

Stack Trace:


[HttpException (0x80004005): The file "~/teaching/teaching-layout.cshtml" cannot be requested directly because it calls the "RenderBody" method.]
   System.Web.WebPages.WebPageBase.EnsurePageCanBeRequestedDirectly(String methodName) +181
   System.Web.WebPages.WebPageBase.RenderBody() +32
   ASP._Page_teaching_teaching_layout_cshtml.Execute() in d:\Websites\jackzheng.net\teaching\teaching-layout.cshtml:26
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +99
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +182
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +142


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.4069.0