CodeAve.com CodeAve.com - ASP - Read/Write
ASP
·Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·Articles
·Miscellaneous
·Contents
·What's New?
JavaScript
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Directory Drill Down
Many websites have some form of hyperlink navigation as you drill down further into the site.  Many times the scheme that the drilldown follows is the directory path of the site.  If this is how our site is structured you may benefit from this example that can be placed on any asp document.  Utilizing two server variables (http_host and script_name) and splitting the script_name by the "/" delimiter you can effortlessly add hyperlinks to all the parent directories in your web.
View the Output
Text View
Print View
Mail this Link
Download the Code

<title>CodeAve.com(Directory Drill Down)</title>
<body bgcolor="#FFFFFF">
<%
'Capture the name of the host server and add http:// to the varible
host= "http://" & request.servervariables("http_host")

'Caputre the name of the page as well as directory structure
script_name=request.servervariables("script_name")

'Split the directory tree into an arry by /
split_name=split(script_name,"/")

'Sets the number of directory levels down
'this document is from the top level directory
'--remove the -1 if you wish to display the name of the page
' with the hyperlink drill down --
num_directory=ubound(split_name)-1
%>


<a href="<%= host %>">
<%= host %></a><%
'Loop that will output all of the parent directories
'and hyperlink them

for counter= 1 to (num_directory)
link=link & "/"& split_name(counter) %>
/<a
href="<%= link %>"><%= split_name(counter) %></a><%
next %>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3