Reputation: 3137
There's a moment in my page where I connect to a database and retrieve some data. One field in special is html code. I want to display it in my page as html inside some control that understands it. What are my options?
Upvotes: 0
Views: 648
Reputation: 6638
Use a literal.
.aspx:
<asp:Literal runat="server" ID="myLiteral" />
codebehind:
myLiteral.Text = "<h2> this is a h2 html tag</h2>";
this will print out
Upvotes: 2