1

Simple question, I have a simple _Layout page and I am trying to group all my javascript at the bottom, like below:

<!DOCTYPE html>
<html>
    <head>
        <title>@ViewBag.Title</title>
        @RenderSection("ViewCssIncludes")
    </head>
    <body>
        @RenderBody()
        @RenderSection("ViewJavascriptIncludes")
    </body>
</html>

Now currently I have 2 partials which include js files relating to their partial (presenter/view js files). So I would be wanting to inject into 1 section from 2 partials, so it would append opposed to overwriting...

Now I am pretty sure you cannot do this, and also I am pretty sure that you cannot call @Section ViewJavacriptIncludes {} from within a partial, but I thought on the off chance that it is possible I would ask in here...

So is it possible to have RenderSections be appended from multiple sources?

Grofit
  • 17,693
  • 24
  • 96
  • 176

1 Answers1

1

Check this answer, it might help.

Community
  • 1
  • 1
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928