As a web page and database solution launched by Microsoft, ASP has developed rapidly due to its unique technical support such as Microsoft's operating system, and is becoming more and more popular. In the current construction of e-commerce websites, Many use ASP to write programs.
Recently, many readers have consulted us about the methods of learning ASP and some problems encountered in learning, some of which are often encountered and faced by beginners. In order to allow readers to deepen their understanding of ASP during the process of learning ASP and to effectively solve the problems encountered, we have specially collected some representative questions, listed them here and answered them one by one, hoping to This limited space helps you learn ASP.
1. Question: Is ASP a programming language?
Answer: ASP is not a programming language, but a development environment. ASP provides an environment for executing instructions on the server side, which uses special symbols () to distinguish HTML from commands that must be translated by the server before being sent to the client. It can execute instructions including HTML language, Microsoft VBscript, Microsoft Jscript, etc., so it can create powerful web applications.
2. Question: Can PWS be used if you accommodate multiple Web sites on a web server?
A: Only one Web site can be accommodated on PWS. In order to accommodate multiple Web sites on the same computer, Windows NT Server or Windows 2000 Server/Professional and IIS are required.
3. Question: How to use 6 built-in ASP objects?
Answer: ASP provides multiple embedded objects, and they can be accessed and used directly in instructions without creating them. These six objects are mainly: Request object, Response object, Working phase object, Application objects, server objects, and cookies objects. The server objects in these six objects can load other components, which can extend the functions of ASP.
The life cycle of an object created with Server.CreateObject begins when it is established and ends when the web program it is located. If you want to make this object use across web pages, you can use the Session object to record the object created by Server.CreateObject.
4. Question: Why do you get the following error when using Response.Redirect: Title error, HTTP title has been written to the user browser, and any HTTP title must be modified before writing to the page content?
Answer: Response.Redirect can transfer web pages to another web page, and the syntax structure used is as follows: Response.Redirect URL, where the URL can be a relative address or an absolute address, but is used in IIS4.0 and is used in IIS5.0. It's different.
Transfer web pages in IIS4.0 must be done before any data is output to the client browser, otherwise an error will occur. The so-called data here includes HTML volume tags, such as: <HTML>, <BODY>, etc., and has been improved in IIS5.0. The buffer is enabled by default in IIS5.0, so this error does not Regenerate.
There is a Buffer property in the Response object, which can set whether the website will transfer data to the client immediately after processing the ASP, but setting this property must also be before any data is transferred to the client.
To be on the safe side, no matter what ASP running platform is used, write < %Response.Buffer=True %> at the beginning of the page and set the buffer to turn on, so that the error will not happen.
5. Question: Does buffered output have any impact on web page transmission?
Answer: In relatively large web pages, the first part may have some delay in the browser, but the speed of loading the entire web page is faster than not buffering.
6. Question: Can I use the Request.QueryString collection to query the value of a string when there is no form submission?
Answer: The Request object is used to read the browser's data. In addition to reading the content of the form field, it can also be used to read the parameters attached to the URL. No matter how the request string is added to the link address, for Request Nothing is different. You can use the Request.QueryString collection to submit a form or follow a link to an additional query string to query all values in the query string.
7. Question: I have written a lot of comments in the ASP script. Will this affect the speed of the server processing ASP files?
Answer: It is a good habit to make comments during the process of writing programs. After testing by foreign technicians, the overall performance of ASP files with too many annotations will only drop by 0.1%, which means that in actual applications, there is basically no degradation of the server's performance.
8. Question: Do you need to use < % @LANGUAGE=VBscript % > at the beginning of each ASP file?
Answer: The code used at the beginning of each ASP file is to notify the server that VBscript is now used to write programs, but because the ASP's preset programming language is VBscript, the code can run normally if you ignore it. , but if the program's scripting language is JavaScript, you need to specify the scripting language used on the first line of the program.