Setting Layout to null in _Layout.cshtml
问题 Is there a reason why you would want to set the Layout property to null in a _Layout.cshtml? For example, like this, before rendering the body view? ... <section id="content"> @{ Layout = null; } @RenderBody() </section> ... It seems pretty nonsensical to me, and removing the line setting Layout doesn't change the way page loads work observationally. Is there any reason why you would want to set the Layout property in _Layout.cshtml? 回答1: Layout pages can have a layout too. In nested layouts