ASP Design FAQ and Solution Essentials (1)

Source: Internet
Author: User
Tags object comments query string client
Solution | design | Problem as Microsoft launched the Web page and database solutions, ASP because of Microsoft's unique operating system and other technical backing support, it has been rapid development, and is receiving more and more welcome, in the current E-commerce site in the construction of a lot of the use of ASP to write programs.

Recently, many readers have consulted us about the methods of ASP and some problems encountered in learning, some of which are problems that beginners often encounter and face. In order to let the reader in the process of learning ASP to deepen the understanding of the ASP, and can effectively solve the problems encountered, we specifically collected some of the more representative of some of the problems, listed here and give answers to each, I hope in this limited space for you to learn ASP help.


1. Question: Is ASP a programming language?

A: ASP is not a programming language, but a development environment. ASP provides an environment for executing instructions on the server side, which utilizes special symbols <% and%> to differentiate between HTML and commands that must be translated by the server to be sent to the client. The instructions that it can execute include the HTML language, Microsoft VBScript, and Microsoft JScript, so you can create powerful Web applications.

2. Question: Can you use PWS for hosting multiple Web sites on a Web server?

A: Only one Web site can be accommodated on the PWS. To accommodate multiple Web sites on the same computer, you need to use Windows NT Server or Windows Server/professional and IIS.

3. Question: How to use 6 built-in ASP objects?

A: ASP provides a number of inline objects that can be accessed and used directly in instructions without having to be established, with the following six objects: Request object, Response (Response) object, Session object, application (application) object, Servers (server) objects, cookie objects, server objects in these six objects can load other components, which can extend the functionality of the ASP.

The object created by using Server.CreateObject, its lifecycle begins when it is established, and ends at the end of its web page program. If you want the object to be used across pages, you can use the session object to record the object that Server.CreateObject created.

4. Question: Why the following error occurred when using Response.Redirect: "Title error, HTTP headers have been written to the client browser, changes to any HTTP headers must be made before the page content is written"?

A: Response.Redirect can transfer the page to another page, using the syntax structure is this: Response.Redirect URL, where the URL can be a relative address or an absolute address, but in IIS4.0 use and in IIS5.0 use is different. The IIS4.0 Transfer Web page must occur before any data is exported to the client browser, otherwise an error occurs. The so-called data here includes HTML labels, such as:< html>,< body>, which have been improved in IIS5.0, and the buffer is turned on by default in IIS5.0, and such errors are no longer generated.

There is a buffer property in the response object that can set whether the Web site will transfer data to the client immediately after processing the ASP, but setting this property must also precede the transfer of any data to the client.

For the sake of insurance, no matter what ASP platform to run, write <% response.buffer=true%&gt at the beginning of the page, set the buffer to open, such error will not happen.

5. Question: Does the buffer output have any effect on the transmission of the Web page?

A: In a larger web page, the first part may have some latency in the browser, but it is faster to load the entire Web page than not to buffer.

6. Question: Is it possible to use the Request.QueryString collection when the value of a query string is not submitted by a form?

A: The request object is used to read the browser's data, except that it can read the contents of the form field and can be used to read parameters that come with the URL, regardless of how the request string is added to the link address. You can use the Request.QueryString collection to submit a form using the Get method, or to follow all the values in the linked query string of an additional query string.

7, the problem: I wrote a lot of comments in the ASP script, this will affect the speed of the server processing ASP files?

A: In the process of writing a program, it is a good habit to make comments. After testing by foreign technicians, the overall performance of an ASP file with too many annotations will only drop by 0.1%, which means that the performance of the server is basically not felt in the actual application.

8. Question: Do you need to use <% @LANGUAGE =vbscript at the beginning of each ASP file?

A: At the beginning of each ASP file, use <% @LANGUAGE =vbscript%> code is used to inform the server to use VBScript now to write programs, but because the default program language of ASP is VBScript, so ignore this code can also run correctly, However, if the script language of the program is Javascrip, you need to indicate the scripting language used in the first line of the program.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.