HttpEncoder::JavaScriptStringEncode Method (String^)

.NET Framework (current version)

Encodes a string.

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

public protected:
virtual String^ JavaScriptStringEncode(
	String^ value


Type: System::String^

The string to encode.

Return Value

Type: System::String^

An encoded string.

URL encoding makes sure that all browsers correctly transmit text in URL strings. Characters such as a question mark (?), ampersand (&), slash (/), and spaces might be truncated or corrupted by some browsers. Therefore, these characters must be encoded.

.NET Framework
Available since 4.5
Return to top