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 help you learn ASP in this limited space.
Question 1: 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.
Question 2: 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.
Question 3: 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, Session object, Application object, Server object, and Cookies object. The server object among 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.
Question 4: Why do you get the following error when using Response.Redirect: "Title error, HTTP header has been written to the user browser, and any HTTP header 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 it is different from using it in IIS4.0 than using it in IIS5.0.
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 turned on by default in IIS5.0, and such errors will no longer occur.
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.
Question 5: 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.