Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > how to get relative links to work in a include file.

Reply
Thread Tools

how to get relative links to work in a include file.

 
 
diablo
Guest
Posts: n/a
 
      06-25-2005
hi

all my pages have a menu of links on the left side.

i want to use a include file <!--#include file="" --> to hold the menu but i
am having a problem

here is my folder structure

foldA
---foldb
------fb.asp

inc
---links.asp

page1.asp


now in page1.asp i include the links.asp file.

in links.asp there is a link like so

<a href="../foldA/foldAA/fb.asp">foldB</a>

now when i load page1.asp and click the link i get a file not found because
it is looking for the file at a place relative to page1.asp not to
links.asp.

is there a way i can do this? or do i need to put in the whole url for each
link in my links page?

thanks

D



 
Reply With Quote
 
 
 
 
diablo
Guest
Posts: n/a
 
      06-25-2005
ok i have kind of resolved this - or rather got a work around for it.

if i create a folder on my live site called TEST ( or the same name of my
virtiual folder on my local pc) then i can use

<!-- #include virtual="test/inc/links.asp" -->

in any place and it will always get the file.

and i can use

<a href="/test/foldA/foldAA.fb.asp">

and it will link from any place.

just a bummer that i have to have my site within a folder


"diablo" <(E-Mail Removed)> wrote in message
news:jBgve.4167$(E-Mail Removed)...
> hi
>
> all my pages have a menu of links on the left side.
>
> i want to use a include file <!--#include file="" --> to hold the menu but

i
> am having a problem
>
> here is my folder structure
>
> foldA
> ---foldb
> ------fb.asp
>
> inc
> ---links.asp
>
> page1.asp
>
>
> now in page1.asp i include the links.asp file.
>
> in links.asp there is a link like so
>
> <a href="../foldA/foldAA/fb.asp">foldB</a>
>
> now when i load page1.asp and click the link i get a file not found

because
> it is looking for the file at a place relative to page1.asp not to
> links.asp.
>
> is there a way i can do this? or do i need to put in the whole url for

each
> link in my links page?
>
> thanks
>
> D
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update to FAQ - Relative URLs for In-page Links and Links to Notes Garrett Smith Javascript 14 05-26-2009 04:50 PM
/* #include <someyhing.h> */ => include it or do not include it?That is the question .... Andreas Bogenberger C Programming 3 02-22-2008 10:53 AM
IE6 acting weird with relative include of js and css files having ..in the beginning Imran Sadat HTML 4 01-11-2008 09:05 PM
Make A Shorter Link - no new links accepted, old links still work. why? Computer Support 7 01-02-2007 09:45 PM
How to get HTML from a relative URL? WebRequest, WebResponse won't work in my case John ASP .Net 1 03-05-2005 11:06 AM



Advertisments