Is there an easier way to do Classic ASP "relative path"?

Posted by Alex.Piechowski on Stack Overflow See other posts from Stack Overflow or by Alex.Piechowski
Published on 2012-04-15T02:07:52Z Indexed on 2012/04/15 17:29 UTC
Read the original article Hit count: 231

Filed under:

Right now, I'm having trouble. First of all I have a page, let's call it "http://blah.com/login".

That obviously goes strait to "index.asp"

A line of Main.asp:

<!--#include file="resource/menu.asp"-->

Page top includes all of what I need for my menu... so:

Part of resource/menu.htm:

<div id="colortab" class="ddcolortabs">
<ul>
<li><a href="main.asp" title="Main" rel="dropmain"><span>Main</span></a></li>

...

</ul>
</div>
<!--Main drop down menu -->
<div id="dropmain" class="dropmenudiv_a">
<a href="main/announcements.asp">Announcements</a>
<a href="main/contacts.asp">Contact Information</a>
<a href="main/MeetingPlans.asp">Meeting Plan</a>
<a href="main/photos.asp">Photo Gallery</a>
<a href="main/events.asp">Upcoming Events</a>
</div>

Let's say I click on the "announcements" (http://blah.com/login/main/announcements.asp) link... Now I'm at the announcements page! But wait, I include the same menu file. Guess what happens: I get sent to "http://blah.com/login/main/main/announcements.asp Which doesn't exist...

My solution: Make a menu_sub.asp include for any subpages. But wait a second... this WORKS, but it gets REALLY REALLY messy... What can I do to use just one main "menu.asp" instead of "menu_sub.asp"? using "/main/announcements.asp" WON'T be an option because this is a web application that will be on different directories per server. Any ideas? PLEASE

© Stack Overflow or respective owner

Related posts about asp-classic