Create | object | | | |
One, ASP Chinese display of two ways to solve
The author just began to write asp+ program when encountered the first big problem is the Chinese display problem, run found asp+ from the database to read out of all the Chinese into the?????, a bit like JSP in this frequency appears the highest Chinese display problem, Check the data found a way to easily solve the Chinese problem.
Method One:
After browsing the Microsoft NGWS document found that in the common problem section of the document mentioned to add a Config.web file to the Web directory, try, the Chinese display is OK.
The method is as follows:
Create a file Config.web, as follows, in the web directory
Requestencoding= "Utf-8"
Responseencoding= "Utf-8"
/>
Later on the internet to see someone posted in the forum said will Utf-8 replaced gb2312 seems to be able to, the author has not tried, we can try.
Method Two:
Later subscribed to Microsoft's newsgroups and found articles in Microsoft's newsgroup dotnet.framework.aspplus.general that discussed the issue, by adding <%@ CODEPAGE = "936"%> to the beginning of each page, somewhat similar to the <%@ in JSP Page contenttype= "text/html;charset=gb2312"%> hurriedly test a moment, sure enough OK!!!
Examples are shown below:
<%@ CODEPAGE = "936"%>
<%@ Import namespace= "System.Data"%>
<%@ Import namespace= "System.Data.ADO"%>
<%@ Import namespace= "System.Globalization"%>
Second, ASP create the skills of the object
When we use server components to create objects, there are generally two methods. The more common approach is to use the CreateObject () method of the server object, like this:
SET Nextlink = Server.CreateObject ("MSWC. Nextlink ")
This approach works well, but there is a way to save system resources.
When you create an object with the Server.CreateObject () method, the object is immediately loaded, and the system allocates memory and other resources to the object.
The second way to create an object is to take advantage of the HTML < OBJECT > tag, which is the syntax:
< OBJECT runat=sever Id=nextlink progid= "MSWC. Nextlink "></object >
When you create an object with the < OBJECT > tag, the object you are creating is not loaded immediately, but until the object's methods or properties are referenced for the first time. In this way, we will save some resources. It's not much, but it helps save server resources when your system has to endure nearly million clicks a day.