I have an MVC 4 site with an area. I setup two script bundles, one for all common scripts the site will need and the other for scripts related to area. I have a common layout view for the site where the common site bundles are referenced using Scripts.Render(). I have a second layout view for the area, which uses the common layout view, where I would like to render the area-specific javascript files, but it does not work and no files are rendered at all. If I move the bundle render to the root layout view, it renders fine.
Any reason why this does not work in the area view and how I can get it to work? I'd rather not have these area-specific scripts available for all users, since only a very small, defined subset actually need them.
Common Layout View:
@Scripts.Render(@"~/Scripts/all_scripts")
...
@RenderSection("Javascript", required: false)
Area Specific View:
@section Javascript {
@Scripts.Render(@"~/Scripts/area_scripts")
@RenderSection("Javascript", required: false)
}