Click to See Complete Forum and Search --> : To Parent Directory
theghost
November 1st, 2005, 03:58 PM
I would like to display the contents of a folder on my web site. The folder contains pdf files.When the folder is diplayed on the site it also shows the link "To Parent Directory". Is there a way to get rid of this or another way to display the list of files in the folder???
I am using VB .net on the code side.
Thanks,
Jason
Alsvha
November 2nd, 2005, 02:06 AM
Well - personally, if I needed to display a folder or folders and content to the users, I'd write my own list and display that.
This way you can control fully what is shown to the user (for instance no access to parent directories) and what rights he has with it.
Look into the System.IO.FileInfo and DirectoryInfo and associated functionality for this. It is quite simple :)
theghost
November 2nd, 2005, 07:57 AM
I am looking into that now. I want to use a hyperlink for each file. I did not want to redo my hyperlinks each time I added or changed the contents of the folder. I don't know if I can create the links on the fly or not. I have not jumped into the vb.net or asp.net yet. I am still dwelling in vb6. Can I create the links on the fly??
Thanks,
Jason
HanneSThEGreaT
November 2nd, 2005, 08:23 AM
You could try:
Response.Write("<A HREF=link_location ....>Link Title</A>")
To create links...
Alsvha
November 3rd, 2005, 06:35 AM
Or simply create the link dynamically using the asp.net hyperlink control and add it to the control/page, instead of response.writing the html code.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.