ASP. NET about the front-end script to pass Chinese parameters, background get garbled (garbled box, black box, etc ..)

Source: Internet
Author: User

Notes for dishes

About ASP. NET about Chinese parameters passed by foreground scripts, garbled characters are obtained in the background (garbled box, black box, etc ..) There are actually many solutions to this garbled problem.
Generally, you only need to add escape or encodeuri to the script parameter, and the Chinese characters can be obtained without any operation in the background.

In fact, many jquery frameworks are used in scripts. When using framework controls, parameters passed are easily garbled. Sometimes you use a window. Open ("............ ") It is normal to pass the parameter. For example, if you use

$. Ligerdialog. Open ({Height: 600, URL: XXX. aspx? Type = '+ "", width: 1000}); after the special transfer method of this pop-up box control, the Chinese parameters obtained in the background are often garbled,
But sometimes we don't want to modify the foreground script. This can be added in Web. config.CodeThis operation is intended for a page.
<Location Path = "XXX. aspx">
<System. Web>
<Globalization requestencoding = "gb2312" responseencoding = "gb2312"/>
</System. Web>
</Location>

If all pages are required, add <globalization requestencoding = "gb2312" responseencoding = "gb2312"/> to the <system. Web> node.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.