Q:

How do I get/render the raw HTML from Blazor components?

0

This code will help you to understand how to get/render the raw HTML from Blazor components.

All Answers

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

String values are normally converted in DOM text notes. To render encode string values as raw HTML you need to wrap the string value in a MarkupString. This will encode the given string value HTML/SVG and place it in the given location.

Refer to the following code sample.

@((MarkupString)RawString)
 
@code {
    public string RawString = "<span style='color:red'>Blazor is awesome</span>";
}

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