title: Razor- MVC - ASP.NET master pages - Method to somehow map multiple Razor Sections to multiple masterpage content blocks?
body: <p>I have Razor working minimally with master-pages using the following technique:</p>
  
  <p><a href="http://www.hanselman.com/blog/MixingRazorViewsAndWebFormsMasterPagesWithASPNETMVC3.aspx" rel="nofollow">http://www.hanselman.com/blog/MixingRazorViewsAndWebFormsMasterPagesWithASPNETMVC3.aspx</a></p>
  
  <p>This works almost perfectly (Calling RenderPartial from the MasterPage on the RazorView.) The only short coming is I have 3 content blocks (controls) in my master page. Conceptually this maps nicely to a Razor Layout with 3 sections by the same names. </p>
  
  <p>The only problem is I can;t figure out how to pull each section of a razor layout individually to Render it into the masterpage sections.</p>
  
  <p>I tried setting the ViewBag.Layout in each masterpage section and the having 3 Razor layouts rendering the 3 razor-layout based sections [footer, header, and body]. The problem is Razor doesn't let me Render a razor view implementing multiple sections through a layout only rendering just one section. (It forces me to render all 3.)  </p>
  
  <p>My other attempt was to have the razor layout render the master page control markup along with the razor views. This seems elegant, but the I get an error that the masterpage control collection is read only.</p>
  
  <p>Is there any way that allows me to develop Razor views to a Razor layout and have <em>multiple</em> layout sections map to a master pages equivalent <em>multiple</em> (one works perfectly) content blocks/sections?</p>
  
  <p>Edit: Updated Link to the MasterPage/MVC integration article.</p>