Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 854 Bytes

httputility_javascriptstringencode-escapes-ampersand.md

File metadata and controls

34 lines (24 loc) · 854 Bytes

HttpUtility.JavaScriptStringEncode escapes ampersand

Scope

Minor

Version Introduced

4.5

Source Analyzer Status

Available

Change Description

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

  • Quirked
  • Build-time break

Recommended Action

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.

Affected APIs

  • M:System.Web.HttpUtility.JavaScriptStringEncode(System.String)
  • M:System.Web.HttpUtility.JavaScriptStringEncode(System.String,System.Boolean)

Category

ASP.NET