Escape () is a coded function of JavaScript
Example: Var esstring=escape ("HelloWorld");
In order to prevent data transmission in the read garbled phenomenon, the string is often to use the JS Escape () function to encode the string, and then in the unescape () function decoding, of course, this in the Web front of the JS operation is not difficult. But for the use of JS's escape () encoded string, in the background language processing, how to read it? ASP. NET can not unescape () This function can decode directly. However, it is gratifying that ASP. NET can add other references to handle this problem.
1. Add Microsoft.JScript Reference
First, ASP. NET needs to add a reference to the project: Microsoft.JScript.
Add Microsoft.JScript Reference
2. Using the Unescape () function
When programming, use Microsoft.JScript.GlobalObject.unescape () to decode JS encoded strings with Escape (). For example, "Guangdong" is encoded with JS escape () to "\u5e7f\u4e1c", then in ASP. NET, it can be written to decode:
String strcode = Microsoft.JScript.GlobalObject.unescape ("\u5e7f\u4e1c");
Another method of processing
You can also use Microsoft.JScript.dll without adding references, and download microsoft.jscript.dll,:http://download.pchome.net/dll/m/down-171352-1.html first.
Then put it in the project root directory of the bin directory, you can directly use. The programming code does not change.
Source: Network
ASP. NET uses unescape to read JS Escape encoded string