The first big problem that the author encountered when writing ASP + programs was the problem of Chinese display, after running ASP +, it is found that all the Chinese characters read from the database are changed ?????????????, Similar to this issue in jsp, the most frequently encountered ASP. NET Chinese display problem. I checked the information and found that there are two ways to easily solve the problem of ASP. NET Chinese Question Mark change.
ASP. NET question mark problem solution 1:
After reading the Microsoft NGWS documentation, I found that the FAQ section of this document mentions that you need to add a config. web file
In the web directory, I tried it. The Chinese display is OK.
The method is as follows:
Create a config. web file with the following content in the WEB directory:
- < configuration>
- < globalization
- requestencoding="utf-8"
- responseencoding="utf-8"
- />
- < /configuration>
Later, I saw a post in the Forum saying that it would be okay to change UTF-8 to gb2312. I have not tried it. You can try it.
ASP. NET question mark problem solution 2:
Later, I subscribed to Microsoft's newsgroup, which is in Microsoft's newsgroup dotnet. framework. aspplus. general found an article discussing this issue, the method is to add <% @ CODEPAGE = "936" %> to the beginning of each page, similar to <% @ page contentType = "text/html; charset = gb2312" %>
Hurry up and test it. OK !!!
The example is shown below:
- < %@ CODEPAGE = "936" %>
- < %@ Import Namespace="System.Data" %>
- < %@ Import Namespace="System.Data.ADO" %>
- < %@ Import Namespace="System.Globalization" %>
- < html>
- < head>
- < meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- < /head>
- Automatic Generation using tools for getting started with ASP. NET 2.0 localization technology
- Scope of static variables in ASP. NET Programming
- ASP. NET array basics: declarations, representations, and examples
- Top 10 skills in ASP. NET Programming II)
- Top 10 skills in ASP. NET Programming 1)