Given this nested layout structure:
~/Views/Shared/_layoutBase.cshtml ~/Views/Shared/_layout.cshtml
Where _layoutBase.cshtml
i
I am unable to reproduce the problem. Here's my setup and steps I did.
Add ~/Views/Shared/_LayoutBase.cshtml
:
@RenderBody()
Replace the contents of ~/Views/Shared/_Layout.cshtml
with this:
@{
Layout = "~/Views/Shared/_LayoutBase.cshtml";
}
@section footerScripts{
@RenderSection("footerScripts", false)
}
@RenderBody()
Right click on the project and add an Admin area
Add a TestController to this admin area and add a corresponding ~/Areas/Admin/Views/Test/Index.cshtml
view:
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
}
Index
@section footerScripts{
alert('ok');
}
/admin/test/index