This is an ASP.NET MVC 3 exception message. What it says? What should I do?
OK, I have this code:
@{
Layout = \"~/_Layout.cshtml\";
Page.Title
I faced a similar problem where the layout template indeed has the @RenderSection(...)
but inside an if-else statement
. So when the page executes the statement that doesn't contain the @RenderSection
it will throw that exception. If that is your case, then your solution is a little more complicated, either:
@RenderSection
outside of the statements or @RenderSection
in both if-else statements, or That could be your main problem!