Doubt with _viewStart on MVC4

Asked

Viewed 138 times

2

I have 2 layouts (LayoutPrincipal.cshtml and LayoutInterno.cshtml) to home page is another to the internal page. The internal page will repeat so I did the creation of the _ViewStart which points to the internal page and to test the layout I created a controller and change the path of the page on _viewStart but the question is, I can’t get 2 _viewStart and create 2 controller pointing to them, someone knows how it works in this case?

2 answers

1

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

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

-1

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.