AntiXSS JavaScriptEncode gets HTML encoded?
问题 I've just started using AntiXSS (4.3.0), mostly to use @Encoder.JavaScriptEncode as described here. I installed AntiXSS from Nuget, then added encoderType="Microsoft.Security.Application.AntiXssEncoder, AntiXssLibrary" to <httpRuntime in my Web.config. In my view, I have the following line (within <script> tags): var userId = @Encoder.JavaScriptEncode(User.Identity.GetUserId()); Which I would expect to output var userId = 'user-id'; but instead outputs: var userId = 'user-id'; I assume this