Alireza Noori
Alireza Noori

Reputation: 15253

How to use Microsoft AntiXss 4.x?

I want to use the new version of the AntiXss library from Microsoft. I downloaded it from the Nuget package but I'm not sure where should I go from here. No documentation is provided for the library and all the articles I find on the Web are old. Since a lot has changed and pretty much everything I want to use is marked as deprecated in the library itself, I wonder which is the best way to use this library?

Any help would be appreciated.

Upvotes: 3

Views: 13359

Answers (3)

Jamie Butterworth
Jamie Butterworth

Reputation: 607

Regarding Microsoft.Security.Application.AntiXss being deprecated, Microsoft advises to use Microsoft.Security.Application.Encoder instead. It's a static class inside the same library as the AntiXss class.

Upvotes: 0

Samer Khatib
Samer Khatib

Reputation: 9

using System.Web.Security.AntiXss;

string a = AntiXssEncoder.XmlAttributeEncode(text);

Upvotes: 0

jpvantuyl
jpvantuyl

Reputation: 604

Take a look at this answer to "Why use Microsoft AntiXSS library?" for a hint to get you started.

Upvotes: 1

Related Questions