Doubt with _viewStart in MVC4

2

I have 2 layouts ( LayoutPrincipal.cshtml and LayoutInterno.cshtml ) for the home page and another for the internal page. The inner page will repeat itself so I made the _ViewStart that points to the inner page and to test the layout I created a controller and change the page path in _viewStart mas the question is, can not I get 2 _viewStart and create 2 controller pointing to them, does anyone know how it works in this case?

    
asked by anonymous 19.11.2014 / 19:21

2 answers

1

It's wrong this way. _ViewStart only supports one Layout file at a time.

To do this (one layout inside another), you first need to define the internal Layout as a normal View . The more details inside this View should be created using Partials .

    
19.11.2014 / 21:16
-1

You can separate the main and inner part in Areas , so you can use a different viewStart for each area

    
07.04.2016 / 15:08