Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to put base content in derived component?

I have base component with basic html content and derived component which adds decorations to it. But now I realized I don’t know how to make blazor put base content within derived component. I am looking in my case for something like this:

<div>
<span>my derived decoration</span>
@base_content
</div>

How to tell Blazor to put "here" the base content?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

In your derived components .razor file include a call to base.BuildRenderTree(__builder) .

An example:

@inherits YourBaseComponent

<div>
<span>my derived decoration</span>

@{
    base.BuildRenderTree(__builder);
}

</div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading