Dynamic ASP Navigation

Nathan

Perch
Greetings from a sunny Corfu, Greece.

I am trying to create a dynamic navigation, which will be included in each page.

Basically, I am trying to use this string:
pageUrl = Request.serverVariables("URL")
which for example may have a value of: "/guides/corfu/beaches"

and manipulate it to write.out:

Guides Corfu Beaches

So that the user has some idea where they are within the site and can at a glance navigate back.

I am not very goog at working with strings, and I imagine someone has already coded something similar to what I am looking for, or I am open to suggestions.

Thanks. Enjoy your day.

Nathan
 
Thanks Logo, that's a great function I had not ever noticed before.

But, I am having problems using the array that the function creates. The expression below nav_array(i)=null does not work, how else do i tell - before I go out of range?

<%
pageUrl = Request.serverVariables("URL")
nav_array = Split(pageUrl, "/")
i=0
Do Until nav_array(i) = null
response.write nav_array(i) & "<BR>"
i=i+1
loop
%>



Thanks

Nathan
 
Got it:

nav_array = Split(pageUrl, "/")
ii=0
path=""
for ii = 0 to ubound(nav_array,1)
path=path & nav_array(ii)
if ii<ubound(nav_array,1) then path=path & "/"
%>
<a href="<% =path%>" target="_self"><% =nav_array(ii) %></a>
<%
Next



Thanks for your help Logan, this has really improved and automated my site navigation.
Cheers
Nathan
 
Back
Top