I am trying to read some values from a SharePoint List and render them in my page as HTML. However, it literally shows the HTML tags on the Web Part page and fails to render it.
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
writer.WriteLine("<br />"); // this works
writer.WriteLine(htbl["key"].ToString()); // html fails to render. literally renders the HTML in the string
}
I have seen following approaches already:
- Text to HTML – the JavaScript mentioned seems to be overkill in my opinion. Is there no easier way to accomplish this?
Please advise.
Kris,
what do you put in the single line of text exactly?
I tried the following and this worked without any issues. If you compare this with your webpart class, do you see differences?