0

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>
vyclarks
  • 854
  • 2
  • 15
  • 39
  • You could also use a Literal, and the Mode property http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.literal.mode.aspx – tim Sep 18 '13 at 17:08

1 Answers1

2
Label1.Text = HttpUtilities.HtmlDecode(content);

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

vyclarks
  • 854
  • 2
  • 15
  • 39