Dynamically setting path for include files

Discussion in 'ASP General' started by Dave, Dec 3, 2005.

  1. Dave

    Dave Guest

    I have two environments: DEV and PROD. In DEV I have two independent webs.
    In PROD one of the webs is the root and the other is a subweb of the root.

    Each enviornment has a different file system configuration so I must
    manually change the file location references in my code when I post from DEV
    to PROD.

    For example, I want to reference an include file that is located in the
    subweb from the root web. The physical file structure looks like this....

    --DEV
    c:\inetpub\wwwroot\myroot
    c:\inetpub\wwwroot\mysubweb\includes\mypage.inc

    --PROD
    e:\InetPub\Clients\myroot\mysubweb\includes\mypage.inc

    ....which means if I call the include file from myroot I have to use
    different references ....

    --DEV
    <!--#include file="../mysubweb/includes/mypage.inc"-->

    --PROD
    <!--#include file="mysubweb/includes/mypage.inc.inc"-->


    I am using ASP 3.0 and I have several include files for db connections,
    menus, etc that are shared between the two webs.

    What is the best practice for handling this situtation as efficiently as
    possible?

    Thanks
    Dave
    Dave, Dec 3, 2005
    #1
    1. Advertising

  2. Hi Dave,

    Welcome to MSDN newsgroup!

    Based on my understanding, you want to replace the path in "include" tag
    for deploying the current project to the production environment. If I have
    misunderstood anything, please let me know.

    As far as I know, the good way for current issue is using replacement
    function supplied by IDE. For example, you could change the "../mysubweb/"
    to "mysubweb" in the whole project by using "Replace All" function. And
    then, you can deploy all changed files to the target machine.

    I hope my suggestion will be helpful. If you have any concern, please feel
    free to let me know. I'm looking forward your reply.

    Regards,

    Yuan Ren [MSFT]
    Microsoft Online Support
    Yuan Ren[MSFT], Dec 5, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Bogenberger
    Replies:
    3
    Views:
    903
    Andreas Bogenberger
    Feb 22, 2008
  2. strus_82
    Replies:
    5
    Views:
    3,852
    strus_82
    Mar 30, 2008
  3. \A_Michigan_User\

    Various path/path/files.asp all #include this 1 file

    \A_Michigan_User\, Jul 10, 2005, in forum: ASP General
    Replies:
    1
    Views:
    230
    Jeff Cochran
    Jul 10, 2005
  4. Eric
    Replies:
    10
    Views:
    460
  5. Eric
    Replies:
    0
    Views:
    256
Loading...

Share This Page