0

I have the below code in my MVC application.

 text = Server.HtmlEncode(text);
 text=Encoder.HtmlEncode(text);

what is the difference will do if I use AntiXSS library here?

I passed the value <script>alert("strek")</script>

to the variable text it returns the same output for both the cases. Where it will make difference?

Tom Cruise
  • 1,395
  • 11
  • 30
  • 58

1 Answers1

0

As seen here, Server.HtmlEncode(text) uses a instance of System.Web.HttpServerUtility while AntiXSS' Encoder.HtmlEncode(text) is static.

Community
  • 1
  • 1
diiN__________
  • 7,393
  • 6
  • 42
  • 69