1

I am trying to implement HttpUtility.HtmlEncode (). The string that this method will encode will be used for rendering into html. if it is encoded then how will it render correctly? do I need to decode it again before using it to render? In that case what is the point of encoding if we have to decode it again to render it correctly?

SKTripathy
  • 97
  • 1
  • 9
  • There's not nearly enough detail here to offer a proper answer. – Sam Axe Mar 30 '17 at 07:35
  • 1
    It will render correctly because browsers understand that encoding. You don't need to decode it - encoding is used to *render* characters that can't be displayed in the original form – Panagiotis Kanavos Mar 30 '17 at 07:37
  • There are many usages to HTML encoding. Among them: avoiding security issues (think XSS). Also, showing HTML code to the user (preventing the browser from actually parsing it). – haim770 Mar 30 '17 at 07:38
  • I have a
  • tag in the string that I am encoding. If I do not encode then it displays the text with bullet(as expected). However if I encode it, then it is not.
  • – SKTripathy Mar 30 '17 at 07:47