0

I am trying to take some input from the user with the wisywig text editor plugin. But, when I try to show the text in a label or paragraph, all the html tags become visible. For example,

@string str = "<b>sample text</b>";
<label>@str</label>

should look like

sample text

But it is not. It looks like,

<b>sample text</b>

How can I render a html code string into a html text...???

i am working with .net mvc3 with razor view engine...

dload
  • 11
  • 3

1 Answers1

0

That may happen if HTML entiries are being encoded.

You need to avoid that encoding or do decoding. For example, in PHP you can use http://php.net/manual/en/function.html-entity-decode.php to decode HTML entities.

Māris Kiseļovs
  • 16,957
  • 5
  • 41
  • 48
  • @dload, well then go ahead and mention it by updating your question. And also include relevant code snippets to make your question clearer. – Darin Dimitrov Nov 15 '11 at 10:45