Be able to use cumulative @section declaration
Suppose that we have a @RenderSection("ScriptsContent") in the _layout.cshtml file.
If i use "@section ScriptsContent" in a View and i also use the SAME section in a PartialView, i would like to have it cumulative.
So the @RenderSection("ScriptsContent") will render the one declared in the View + the one declared in the PartialView.
It will be very usefull when you want to have all your scripts at the bottom of you page and want to declare them here and there in your view and partial view.
Murali M commented
+2 votes.. I too have the same issue. Most of the places i have the partial view defined inside each tab. Each tab is configured based on permission.
Even though the user doesnt have a permission i simply load all the scripts in my view page which is having the tab.
Aaron Shumaker commented
Even with the new bundling features, you still have to call @Scripts.Render("~/bundles/somethingSepcificToMyPartial") and it needs to be placed in the appropriate location. Well, since my partial doesn't have access to the scripts section, it can't place it in the appropriate location. This is still an issue which stands in the way of creating partials which are highly reusable and the new bundling features do not solve this problem as far as my testing concludes.
Also consider merging these which are essentially the same request I believe: http://aspnet.uservoice.com/forums/41201-asp-net-mvc/suggestions/2204831-be-able-to-use-cumulative-section-declaration
Alexandre Jobin commented
a good workaround that i've found is to have a script block template. You can use it in View and PartialView and you parse the result in your master layout. More details can be found there:
maybe something similar can be integrated in the next MVC version?