Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple content placeholders in mvc?

<div class="welcome">                      
      <asp:ContentPlaceHolder runat="server" ID="FeaturedContent" />
      <div style="margin: 10px 0;">
          <asp:ContentPlaceHolder runat="server" ID="MainContent" />
      </div>
      <!-- etc -->
</div>

I have master page in asp.net project which have two content place holder? Now i am trying to create. this project in MVC how to to take two content place holder in _Layout.cshtml. So at derived page i can put my content's in between this.

like image 371
Saurabhchauhan232 Avatar asked Oct 20 '22 09:10

Saurabhchauhan232


1 Answers

Razor also supports the ability to add additional "named sections” to layout templates as well. These sections can be defined anywhere in the layout file (including within the section of the HTML), and allow you to output dynamic content to multiple, non-contiguous, regions of the final response.

Read below link : http://weblogs.asp.net/scottgu/archive/2010/12/30/asp-net-mvc-3-layouts-and-sections-with-razor.aspx enter image description here

like image 155
Kumar Manish Avatar answered Nov 02 '22 12:11

Kumar Manish