Q:

How do I render raw HTML in Blazor?

0

This code will help you to understand how to render raw HTML in Blazor.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

How do I render raw HTML in Blazor?
Raw HTML can be rendered in Blazor by using the MarkupString. You can set the raw HTML as a string to any parameter and cast it in a markup string.

@page "/"

@((MarkupString)myMarkup)

@code {
              string myMarkup = "<p class='markup'>This is a <em>markup string</em>.</p>    <button class='btn btn-primary'>Button</button>";
   }

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now