Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 1010 Bytes

httputilityjavascriptstringencode-escapes-ampersand.md

File metadata and controls

29 lines (18 loc) · 1010 Bytes

HttpUtility.JavaScriptStringEncode escapes ampersand

Details

Starting with the .NET Framework 4.5, xref:System.Web.HttpUtility.JavaScriptStringEncode(System.String)?displayProperty=fullName escapes the ampersand (&) character.

Suggestion

If your app depends on the previous behavior of this method, you can add an aspnet:JavaScriptDoNotEncodeAmpersand setting to the ASP.NET appSettings element in your configuration file.

Name Value
Scope Minor
Version 4.5
Type Runtime

Affected APIs

  • xref:System.Web.HttpUtility.JavaScriptStringEncode(System.String)?displayProperty=nameWithType
  • xref:System.Web.HttpUtility.JavaScriptStringEncode(System.String,System.Boolean)?displayProperty=nameWithType