Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

How to display a text (Html format) in a website (Asp.net C#)

$
0
0

I have a ckeditor editer, after applying format to the text I display the text when a button is clicked. I want the text to be displayed with all the formatting applied in the text editor.

In order to avoid xss, I do Server.HtmlEncode(content).But it is not displayed in the format applied .

Example:

   I would like like the text is bold,So :<strong>bold text</strong>

  But after Server.HtmlEncode("<strong>bold text</strong>"),the format is not applied,the bold text is not bold.

  How to do?Tks!


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>