I have a string HTML text saved in a string
variable. for example it looks like this:
sample.aspx.vb
Dim htmlStr As String = "<h1> Hi </h1>"
I want the htmlStr
variable’s content formatted as a HTML tag and displayed in the aspx
page. How can I do this ?
It should look like this:
Hi
2
Answers
A LiteralControl can contain HTML.
https://learn.microsoft.com/en-us/dotnet/api/system.web.ui.literalcontrol?view=netframework-4.8
Simple drop in a control on the form you want to use. A plaine jane "div" is fine, or even a label works. (a text box will not).
So, say I drop in this div (and a button)
Now, code behind can be this:
and now we get/see this: