Dynamic Directory Listings

D

Dan King

I have an ASP page that currently gives me an output of file listing with
links to each of them for the current directory.
The problem I am having is there are getting to be too many folders. I
currently have the ASP page copied into each folder and sub folder, but if I
want to make a change, I have to change all the ASP files.

Is there a way I can create either:
Have a simple index.asp page that will reference and run my code in my
current ASP page? This way I have only one complex file to change, and
simple index in each folder.

Or

Can I create an index page at the root of the server that will give me a
folder listing, and then when I click on a link to a folder it can pass the
new current directory to the root index page to give a listing of the new
current directory?

Any code snippets would be appreciated.

I am currently using directory listings in IIS, but this is an ugly way, and
I want to be able to clean it up.

Thanks,
Dan
 
S

Steven Burn

You can use a single page in the root, and Request.Querystring() to
determine the folder to be read.

<%
strTemp = request.querystring("folder")
if strTemp = "" then strTemp = "./" '// current folder
set fldr = fso.getfolder(server.mappath(strtemp))
%>

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top