-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
Layout
value
- #3745
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,8 +155,12 @@ private async Task RenderViewStartsAsync(ViewContext context) | |
var viewStart = ViewStartPages[i]; | ||
context.ExecutingFilePath = viewStart.Path; | ||
|
||
// Copy the layout value from the previous view start (if any) to the current. | ||
viewStart.Layout = layout; | ||
// If non-null, copy the layout value from the previous view start to the current. Otherwise leave | ||
// Layout default alone. | ||
if (layout != null) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dougbu
Author
Member
|
||
{ | ||
viewStart.Layout = layout; | ||
} | ||
|
||
await RenderPageCoreAsync(viewStart, context); | ||
|
||
|
@@ -170,8 +174,11 @@ private async Task RenderViewStartsAsync(ViewContext context) | |
context.ExecutingFilePath = oldFilePath; | ||
} | ||
|
||
// Copy the layout value from the view start page(s) (if any) to the entry page. | ||
RazorPage.Layout = layout; | ||
// If non-null, copy the layout value from the view start page(s) to the entry page. | ||
if (layout != null) | ||
{ | ||
RazorPage.Layout = layout; | ||
} | ||
} | ||
|
||
private async Task RenderLayoutAsync( | ||
|
Should this instead check if
viewStart.Layout != null
? cc @sebastienros