title: How to use Razor Section multiple times in a View & PartialView (merge) without overriding it?
body: <p>In the _Layout.cshtml file, I have a section at the bottom of the body called &quot;ScriptsContent&quot; declared like this:</p>
  <pre><code>@RenderSection(&quot;ScriptsContent&quot;, required: false)
  </code></pre>
  <p>In my view, I can then use this section to add scripts to be executed. But what if I also have a PartialView that also need to use this section to add additional scripts?</p>
  <p><strong>View</strong></p>
  <pre><code>@section ScriptsContent
  {
      &lt;script type=&quot;text/javascript&quot;&gt;
          alert(1);
      &lt;/script&gt;
  }
  
  @Html.Partial(&quot;PartialView&quot;)
  </code></pre>
  <p><strong>PartialView</strong></p>
  <pre><code>@section ScriptsContent
  {
      &lt;script type=&quot;text/javascript&quot;&gt;
          alert(2);
      &lt;/script&gt;
  }
  </code></pre>
  <p><strong>Result</strong></p>
  <p>Only the first script is rendered. The second script doesn't exist in source code of the webpage.</p>
  <p>Razor seems to only output the first <em>@section ScriptsContent</em> that it sees. What I would like to know is if there's a way to merge each call to the section.</p>
  <p>If we cannot do this, what do you propose?</p>