Question

I use FreeTextBox for my webpage. And when I load the text again from Database to display on a Label, it doesn't display correctly( still contain HTML tag: ,...) Take a look at my code below ( load the text from the DB)

Datatable db= excute .....;
string content = db.Rows[0]["CONTENT"].toString();

Label1.Text= content;

Just a basic codes , I really don't know where is the mistake.

Label1.Text ----> Demo freetextbox<div> just a simple demo</div><div>dnalksdfasdflklsd</div>
Était-ce utile?

La solution

Label1.Text = HttpUtilities.HtmlDecode(content);

It decode the text, and the text will be displayed correctly.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top