Aspnetcore: Blazor Layouts with several placeholders (Header/Footer/etc) like MVC Sections/WebForms

Created on 10 May 2019  路  2Comments  路  Source: dotnet/aspnetcore

What I'm trying to achieve is a component like this:

@inherits LayoutComponentBase
<div>
   Here some html from the layout's header...
  @ExtraHeader

   Here will be the child body: 

   @Body

   Now some footer... 
   @ExtraFooter
   Some more footer...
</div>

Suppose I want to dedicate that @ExtraHeader and @ExtraFooter to be implemented by all the children who use this layout that need to. Is this possible in Blazor right now somehow?

I know we have @Body, but that only supports nesting, not putting content in other places like MVC Sections.
You could do that too in webforms with something like this inside a MasterPage:



Thanks!

Design area-blazor

Most helpful comment

Thanks for contacting us, @chrdlx.
This is an area we have been debating about quite a bit. We're going to think more about this in the coming future and decide how we move forward from there.

All 2 comments

Thanks for contacting us, @chrdlx.
This is an area we have been debating about quite a bit. We're going to think more about this in the coming future and decide how we move forward from there.

Was this page helpful?
0 / 5 - 0 ratings