Jump to content

#include Issues


Recommended Posts

First time poster, so please be gentle :)Bit of background - im fresh out of uni and have just scored my first web admin position. I have had no previous experience working with ASP or ASPX, but have a good knowledge of HTML and basic web design.I was approached by my current employer to re-design their current website. Im using the already built structure and making a cosmetic edit to generally clean the site up.The page runs through ASP, making use of an online shopping cart, and uses the #include command to set up it's layout with a header and footer.After editing the code in the already existing pages and applying some changes, I haven't been able to get the #include command working through straight ASP.However, when i save the page that uses the #include script as a .ASPX file, everything works fine. The header and footer pages are not edited and stay as straight .ASP files.My gripe here is that the online shopping cart code has been scripted in straight ASP - and im fairly sure (having no previous exp with ASP coding), that it wont work in ASPX. Being that i have no experience in ASP/X scripting recoding the shopping cart is not an option.What i want to know is why does the #include code work in a .ASPX and not in .ASP pages?As i have only made changes to the already existing files, the main thing that confuses me is that the current site which is live, works fine in using all .ASP pages. Could it just be the fact that i need to include some type of command in the header tags?The error i get when i try using straight ASP is:

Active Server Pages error 'ASP 0126'Include file not found/!!testsite/home.asp, line 4The include file 'header.asp' was not found.

header.asp being the header im trying to include, and home.asp being the target file im using the #include scripts through.My include files look like this:

<!--#include virtual="header.asp"-->

Any information/assitance would be much appreciated!

Link to comment
Share on other sites

It looks like you're trying to include a virtual file, so that might be one issue. I haven't worked a lot with virtual files, but if you copied the site to a new directory to make the changes there, I believe that in order for the virtual include to work you also need to make changes in IIS somewhere. I'm not sure specifically what though.If the header.asp file is in the same directory as the other ASP scripts, you might just try a regular file include:<!--#include file="header.asp"-->

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...