R – Two-step view with ASP.NET MVC

asp.net-mvcmaster-pages

I was programming in Zend Framework and now I am also using ASP.NET MVC.

What I liked in Zend Framework is that the layout (something like Master page in ASP.NET world) is rendered AFTER the main content, so you can use html helper to insert javascript or require some css/js files while generating the main content and than the html helper will place all necessary code in head tag which is usually placed in layout (Master page). Is something like that possible in ASP.NET MVC?

Best Answer

If I understand what you are asking correctly, you can put a content placeholder within the head tag on the master page. This lets you inject anything you like from your content pages.