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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...