Getting include files to work on Windows 2003

I recently been playing around with Windows 2003 because we are still running Windows 2000 Server at work and may be upgrading soon. Our ASP pages are using includes to our database connection page…

<!–#include file="some_folder/db_connection_file.asp" >

If you were to run a page with that code on a Windows 2003 server, you may get an error similar to…

Active Server Pages error ASP 0131
Disallowed Parent Path

To fix this error, I had to do the following:

  1. Create a new virtual directory of the folder that contains the files. We’ll call the virtual directory “example”.
  2. Update the include syntax to use virtual instead. So you’ll have something like
    <! #include virtual=example/some_folder/db_connection_file.asp >
    

You may get this error with javascripts as well if you have something like…

<script language=javascript src="../some_folder/my_script.js"></script>

You should update that syntax to something like…

<script language=javascript src=/example/some_folder/my_script.js></script>

I’m not a big Windows user anymore so I don’t know why it has to be done this way or know of a setting so that the old method still works. But those are the 2 changes I had to make on some of our websites to make them compatible with Windows 2003.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s