I am trying to render a section that is defined in _layout file from my custom area.
In my area I have the _ViewStart which points to the _layout in the root site.
The section that I am trying to use is in the head tag, but in my area it is put in the body.
Page that are rendered at the root level work fine.
~/Views/Shared/_Layout.cshtml
<head>
@RenderSection("header", true)
</head>
<body>
....
</body>
~/Areas/UserMedia/Views/_ViewStart.cshtml
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
~/Areas/UserMedia/Views/ManageProjectMedia.cshtml
@{
ViewBag.Title = "ManageProjectMedia";
}
@section header{
{
<!-- scripts and styles -->
}
<div>
... page content
</div>