I am trying to limit XSS attacks to a site, and am using the AntiXss Library to encode any untrusted strings before including in the response.
AntiXssEncoder.HtmlEncode(_Title, False)
My database value looks like this - If There's a Fire
, which after being encoded shows the html code on screen. Strangely the source code also contains the html code with amp;#39; but browsers shows it as text rather than the correct character.
What am I doing wrong?
The issue was because the value was being encoded twice