HtmlDecode is not working for the following string c#

137 views Asked by At
string testString = "a aa aaa aaaa aaaaa aaaaaa aaaaaaa aaaaaaaa aaaaaaaaa aaaaaaaaaa href=j&#97v&#97script:&#97lert 1  ClickMe";

I used the following code to decode it,

 string a = HttpUtility.HtmlDecode(testString);
 Console.WriteLine(a);

The output is still the same.

I have tried other options like HtmlAgilityPack.HtmlEntity.DeEntitize and HtmlDecode from other packages.

What am I missing?

0

There are 0 answers