HTML Component not displaying HTML

Hi Guys

I hope you can help.

I'm having issues displaying data in the HTML control.

I want to build up a dynamic HTML string to display a report, but it's not displaying. Subsequently, I followed your instructions from this post HTML Component doubt, again this didn't work and I got an error in the code.

Here's the screen shots of the set up:

Dynamic HTML...

Following the example above:

Please advise.

Thanks
Mike

Hi Mike,

You should fix the quotes in your code - you have double quotes inside double quotes.

Indeed I have, still have the issue of the HTML not displaying, this was copying your example. Radzen created the code, I left it there to show you what was automatically created.

Playing around with the Content of the control....

Screenshot 2020-08-04 at 15.33.31

Produces an output string, but not HTML, of course:

Wrap the DIV around the string,

Displays nothing. When I inspect the HTML in the browser I see this:

An empty DIV, the content has not been rendered.

Any ideas?

Hi @MikeT,

This syntax is for Angular. It won't work for Blazor applications.

Ok thanks, what is the Blazor syntax then please.

I have tried setting the content to a string and got this:

It doesn't appear to recognise that it is HTML and displays the actual string.

Thanks for you help in advance.

Hi @korchev

Any thoughts?

Thanks
Mike

Hi @MikeT,

Blazor needs the string to be cast as MarkupString.

Here is how to do that in Radzen.

Put (MarkupString) in front of the value.

1 Like

Thank you, that works.