To render raw HTML in Blazor, wrap the HTML content using the MarkupString type. This allows the HTML or SVG to be rendered as part of the DOM.
@page "/"
@((MarkupString)myMarkup)
@code {
private string myMarkup =
"<p class='markup'>This is a <em>markup string</em>.</p>";
}
Refer to the Blazor documentation for more information.
Share with