I need to call the _ViewStart layout page for every page exept one.
How do I skip it for just one page (let's call it a.cshtml)?
I need to call the _ViewStart layout page for every page exept one.
How do I skip it for just one page (let's call it a.cshtml)?
You can just add this to the top of the page you don't want to use the layout for.
@{
Layout = "";
}
Source SO
If you return PartialView()
from your controllers (instead of return View()
), then _viewstart.cshtml
will not be executed.