Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

HttpUtility.JavaScriptStringEncode Method (String, Boolean)

.NET Framework 4.6 and 4.5

Encodes a string.

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)

public static string JavaScriptStringEncode(
	string value,
	bool addDoubleQuotes


Type: System.String

A string to encode.

Type: System.Boolean

A value that indicates whether double quotation marks will be included around the encoded string.

Return Value

Type: System.String
An encoded string.

.NET Framework

Supported in: 4.6, 4.5, 4
© 2015 Microsoft