Modify the HTML Head from a component
You can change the page title, and set other metadata (from .NET 6 onwards) via the PageTitle
and HeadContent
components.
PageTitle
makes it easy to dynamically update the current page’s title.
HeadContent
is useful for modifying or adding other meta tags to the current page.
<PageTitle>@title</PageTitle>
<HeadContent> <meta name="description" content="@description"></HeadContent>
@code { private string title = "Modify your head";
private string description = "Useful .NET 6 Feature";}