Layout in Razor generated views not working

265 Views Asked by At

I am have created two projects, where Main is the main project and WebApp as the second one. I am using RazorGenerator to call the Areas in my WebApp from Main.

I can access ~/Test/Default/Index of WebApp, however it seems that the Layout code in the _ViewStart.cshtml is not working. I am ending up with just a simple code, without the scaffold _Layout created by Visual Studio.

What the output looks like.

This is the code in my Index. I scaffolded everything from creating an Area, controller and View. The only thing I added was the @* Generator: MvcView *@ in the index.

@* Generator: MvcView *@
@{
    ViewBag.Title = "Index";
}
<h2>Index</h2>

Is there any reason why the View cannot show the layout as well?

0

There are 0 best solutions below