Hi aodponsir,
Yo need to make use of RenderTreeBuilder class AddMarkupContent method.
@page "/"
<PageBuilder></PageBuilder>
Inherit the PageBuilder class with ComponentBase.
public class PageBuilder : ComponentBase
{
protected override void BuildRenderTree(RenderTreeBuilder b)
{
base.BuildRenderTree(b);
b.OpenElement(0, "div");
b.AddMarkupContent(1, HTMLContent());
b.CloseElement();
}
public string HTMLContent()
{
return "<h3>ASPSnippets</h3>";
}
}
References:
https://stackoverflow.com/questions/61274355/blazor-pages-how-to-use-buildrendertree-to-add-dynamic-content
https://stackoverflow.com/questions/70951445/blazor-need-to-create-pages-dynamically