I. ASP object creation skills
When we use server components to create objects, there are generally two methods. The common method is to use the Createobject () method of the server object, as shown in the following code:
Set nextlink = server. Createobject ("mswc. nextlink ")
This method is easy to use, but there is another way to save system resources.
When you create an object using the server. Createobject () method, the object is immediately loaded and the system allocates memory and other resources for the object.
The second method to create an object is to use the HTML <Object> tag. The syntax is as follows:
<Object runat = sever id = nextlink progid = "mswc. nextlink"> </Object>
When you use the <Object> tag to create an object, the object you want to create will not be loaded immediately, but will not be loaded until the method or attribute of this object is referenced for the first time. In this way, we will save some resources. Although not many, it is very helpful to save server resources when your system receives nearly one million clicks every day.
2. asp Chinese display Solution
The author just started to write ASP +ProgramThe first big problem encountered was the problem of Chinese display. After running, it was found that all the Chinese characters read from the database by ASP + were changed ?????, Similar to JSP, the most frequently displayed problem occurs in Chinese. I checked the information and found that there is a way to easily solve the problem in Chinese.
Method 1:
After reading the Microsoft ngws document, I found that the FAQ section of the document mentioned that I want to add a config. Web file to the web directory. I tried it and the Chinese display was 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.
Method 2:
Later, I subscribed to Microsoft's newsgroup. I found a topic discussed in Microsoft's newsgroup DOTNET. Framework. aspplus. General.ArticleThe method is to add <% @ codePage = "936" %> to the beginning of each page, which is somewhat 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>