locked
Classic ASP includes from outside of Root RRS feed

  • Question

  • User229704551 posted

    I'm using IIS 6 and classic ASP. I want to create a virtual directory on my website from a file that is outside of the "default website" but I want to include my "top" and "bottom" (menu system) from within the "default website".

    Default website is sitting at: "e:/website - NAME" (shared as "website - NAME" as well)
    Ffolder for virtual directory is sitting at: "e:/personnel"

    I've tried:

    <!-- #include file="e:/website - NAME/includes/top.asp" -->
    <!-- #include virtual="e:/websitefoldername/includes/top.asp" -->

    <!-- #include file="e:/websitesharename/includes/top.asp" -->
    <!-- #include virtual="e:/websitesharename/includes/top.asp" -->

    <!-- #include file="websitesharename/includes/top.asp" -->
    <!-- #include virtual="websitesharename/includes/top.asp" -->

    <!-- #include file="website - NAME/includes/top.asp" -->
    <!-- #include virtual="website - NAME/includes/top.asp" -->

    Not sure how that works exactly but your help would be most appreciated.

    Friday, February 29, 2008 12:40 PM

Answers

  • User1073881637 posted

    Understood.  Make a virtual directory 'inside' your Default Web Site that points to the files 'outside' your working folder.  In your code reference the virtual directory that points to the folder / files outside your normal structure.  For example

    Your default website is a local folder called c:\websites\example.com.  Under example.com, all your folders and files.  However, the files you want on a file server called FileServerA in a folder called D:\MyWebsiteIncludes.  The UNC path is \\FileServerA\D$\MyWebSiteIncludes or if you create a share on the folder, \\FileServerA\MyWebsiteIncludes  On the web server, create a virtual directory that maps to either share path.  You'll need to make sure the proper credentials are configured to access the files on the remote server. 

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Saturday, March 1, 2008 2:53 PM

All replies

  • User1073881637 posted

    You would use <!--#include virtual=/websitesharename/includes/top.asp-->.   There is no concept drive letters when dealing with IIS and files.  You configure IIS to point to your files.  If the permissions is setup correctly, it should work seemlessly.

    http://www.w3schools.com/asp/asp_incfiles.asp

    Saturday, March 1, 2008 8:05 AM
  • User229704551 posted

    Hi Steve,

    The file I want to include isn't in a virtual directory it's part of my default website. I am working in a folder outside of the default website.

    I'm getting this message:

    "Active Server Pages error 'ASP 0126'

    Include file not found

    /personneltest/Index.asp, line 2

    The include file '/Web Site - FSUS/includes/top.asp' was not found. "

    Saturday, March 1, 2008 1:35 PM
  • User1073881637 posted

    Understood.  Make a virtual directory 'inside' your Default Web Site that points to the files 'outside' your working folder.  In your code reference the virtual directory that points to the folder / files outside your normal structure.  For example

    Your default website is a local folder called c:\websites\example.com.  Under example.com, all your folders and files.  However, the files you want on a file server called FileServerA in a folder called D:\MyWebsiteIncludes.  The UNC path is \\FileServerA\D$\MyWebSiteIncludes or if you create a share on the folder, \\FileServerA\MyWebsiteIncludes  On the web server, create a virtual directory that maps to either share path.  You'll need to make sure the proper credentials are configured to access the files on the remote server. 

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Saturday, March 1, 2008 2:53 PM