Difference
When writing an ASP program, it is common to use the <!--#include virtual/file= "Path/filename"--> to embed a relatively independent file code into the current page. In actual use, many people do not understand the use of "file" and "virtual" , causing the page to execute when there will be errors. A brief description of the issue is given.
When using "file" , a relative path is used after the equal sign. The so-called relative path, is based on the current file folder as the starting point, through the path search, get other files (or folders) and the current file path relationship. when using "virtual" , an absolute path is used after the equal sign. absolute Path, is the site root directory as the starting point, through the path search, get the file (or folder) the full path.
These two definitions are not very well understood, for example: the site root directory for IIS settings is "c:\wwwroot\", a.asp file directory is c:\wwwroot\afolder,b.asp file directory is C:\wwwroot\bfolder, c.asp file directory is C:\wwwroot\afolder\cfolder, then a.asp as a starting point to find b.asp, followed by the path of C:\wwwroot\afolder, C:\wwwroot, c:\wwwroot\ Bfolder, and the search for c.asp, through the path is C:\wwwroot\afolder, C:\wwwroot\afolder\cfolder. As a result, the relative path of b.asp for a.asp is.. /bfolder, the relative path of a.asp for b.asp is.. /afolder。 When the a.asp file needs to be used"File"When the b.asp file is invoked, its statement should be written as<!--#include file= ". /bfolder/b.asp "-->。 Call C.asp, whose statement is<!--#include file= "cfolder/c.asp"-->。 And no matter when, a.asp, b.asp, c.asp the absolute path of these three files isC:\wwwroot\afolder, C:\wwwroot\bfolder, C:\wwwroot\bfolder\cfolder。 Therefore, use in the a.asp file"virtual"Call another two files, respectively<!--#include virtual= "/bfolder/b.asp"-->And<!--#include virutal= "/bfolder/cfolder/c.asp"-->。
Another thing to mention is the distinction between include and IFRAME. The former is to execute a relatively independent file code as part of the calling file code, which belongs to the ASP language and can only be used in ASP files. And the IFRAME is simply a separate file in the call file nested display, the two are completely independent, without any relationship, and the IFRAME belongs to the HTML language, in ASP, HTM, HTML and other files to call.