title: MVC3 Layout Page, View, RenderPartial and getting script files into the Header (from the partial view)
body: <p>So I have a Layout page</p>
  
  <pre><code>&lt;head&gt;
      @RenderSection("HeaderLast", required: false)
  &lt;/head&gt;
  </code></pre>
  
  <p>A view</p>
  
  <pre><code>@section HeaderLast
  {
      &lt;script src="@Url.Content("~/Scripts/knockout-1.2.0.js")"
                              type="text/javascript"&gt;&lt;/script&gt;
  }
  
  &lt;div id="profile-tab"&gt;
          @{ Html.RenderPartial("_userProfile"); }
  &lt;/div&gt;
  </code></pre>
  
  <p>And a Partial view</p>
  
  <pre><code>@section HeaderLast
  {
      &lt;script type="text/javascript"&gt;
          alert('test');
      &lt;/script&gt;
  }
  
  &lt;div......
  </code></pre>
  
  <p>I figured it couldn't be that simple. Is there a proper way to do this out of box or will this always require some kind of mediator and passing stuff around ViewData to manually make the content bubble up to the layout page?</p>
  
  <p><strong>Bounty started:</strong> The bounty will be rewarded to the best solution provided for this short coming. Should no answers be provided I will award it to @SLaks for originally answering this question.</p>