Hi @,
I suggest you could directly using the HeadContent component to set the header inside each razor page, like below:
By using this , there is no need to use any CascadingParameter inside the blazor.
@page "/"
<PageTitle>Home</PageTitle>
<h1>Hello, world!</h1>
Welcome to your new app.
<HeadContent>
<script type="application/ld+json">
@PageHeadContent
</script>
</HeadContent>
@code{
public string? PageHeadContent { get; set; }
//here you could set the content from the database
protected override void OnInitialized()
{
PageHeadContent="test";
}
}
Result:
*****************************************************
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.