Pregunta

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>
¿Fue útil?

Solución

Label1.Text = HttpUtilities.HtmlDecode(content);

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top