Best Solution to Asp.net Ajax updatepanel garbled Problem
In updatepanel, when textbox exists in contentcomplate, Chinese characters are garbled.
There are two solutions:
1. Add in Web. config
Globalization fileencoding = UTF-8 requestencoding = UTF-8 responseencoding = UTF-8 culture = ZH-CN
2. In the backgroundCodeDecoder operations with garbled characters
The above two are not good solutions. The first one may cause problems on other pages. The second one is correct even though it is stored in the database. However, what the user sees is still garbled, this seriously affects user experience. So where is the best solution?
Solution: we can add the location configuration section to the Web. config file to encoding the specific file or directory, as shown below:
< Location Path = "Here is the directory or file name" >
< System. Web >
< Globalization Fileencoding = " Gb2312 " Requestencoding = " Gb2312 " Responseencoding = " Gb2312 " />
</ System. Web >
</ Location >