A default layout can be specified in the /Pages/_Imports.razor file. This setting can be overridden by Blazor finding a more specific _Imports.razor file closer to the page it is rendering. The final (and most explicit) level of specifying a template to use is to literally specify it in the page itself using the @layout directive.

@page "/admin/users"
@layout MainLayout


Note: You can have more than one _Imports.razor file.


Last modified: November 20, 2020



Write a Reply or Comment