I have a default _Layout.cshtml layout for most pages. However, for some page groups, I would like to have a slightly modified default layout. I know that I can just copy this file by changing it a little, but that would mean duplicating the code and supporting two layouts with 99% of the same code.
I would like to inherit the layout from the default:
LayoutInherited.cshtml:
Layout = "~/Views/Shared/_Layout.cshtml"; ViewBag.BodyContentClassSpecial = ""; @section header{ <style> #body-content { width: 90%; margin: 0 auto; } </style>
}
Can I do something like this?
layout asp.net-mvc nested
qub1n
source share