Summary of differences between ASP # include file and # include virtual page 1/2

Source: Internet
Author: User

The "relative path" here is relative to the folder where the "Main call file" is located.

# Include file
# Include file is followed by the "relative path" of the file, and "absolute path" cannot be used ".
Use relative paths, such as: file = "script \ file. Inc", file = ".. \ Script \ file. Inc"
Absolute paths cannot be used, such as: file = "\ Script \ file. Inc"
# Include virtual
# Include virtual can be followed by the "absolute path" of the file or the "relative path" of the form (the so-called "relative path" of the form ", this path is regarded as a "relative path" in form, but it will still be converted to an "absolute path". Therefore, it is essentially an "absolute path ")

Use absolute path, for example, virtual = "\ Folder \ file. Inc"
The relative path, such as virtual = "Folder \ file. Inc", is converted to virtual = "\ Folder \ file. Inc"

We recommend that you use the "absolute path" format, such as virtual = "\ Folder \ file. Inc" instead of virtual = "Folder \ file. Inc ".
Let's talk about the differences based on several examples:CopyCodeThe Code is as follows: Suppose "include file" and "include file" are in the same folder named folder in the root directory, then virtual = "Folder \ file. ASP "is acceptable, while file =" Folder \ file. ASP "is incorrect.
If there are two folders folder1 and folder2 under a website, file1.asp and file2.asp under folder1, and file2.asp under folder2, and file1.asp to call file2.asp, you can write in file1.asp as follows:
<! -- # Include virtual = "\ folder2 \ file2.asp" -->,
In this case, use <! -- # Include file = "folder2 \ file2.asp" --> is incorrect.

Pay attention to the following points during use:

Whether using # include file or # include virtual, you can simply use "/" or "\" or both in the path.

For example, file = ".. \ Script \ file. Inc", file = "../script/file. Inc", file = "../script \ file. Inc"

# Include file and # include virtual can only contain files in the site, but cannot contain files outside the site. For example, assume that a website named website is incorrect when Virtual = "website \ file. asp" is used.

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.