How do I use master page container in partial view

Posted by user200295 on Stack Overflow See other posts from Stack Overflow or by user200295
Published on 2010-05-16T16:23:50Z Indexed on 2010/05/16 16:30 UTC
Read the original article Hit count: 294

I have several partial views with Javascript that I am trying to move to the bottom of the page. To do this I am trying to use a container in the master page

Master Page ->

   <asp:ContentPlaceHolder ID="Foot" runat="server"></asp:ContentPlaceHolder>

Partial view(ascx)

<asp:Content ID="header" ContentPlaceHolderID="head" runat="server">
...
</asp:Content>

But I get this error

Parser Error Message: Content controls have to be top-level controls in a content page or a nested master page that references a master page.

So how do I ensure that the Javascript for the partial view is at the bottom of the page? Especially in cases where the html layout needs to be at the top of the page?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about master-pages