Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 29th, 2004, 11:34 AM
Registered User
Join Date: Mar 2004
Location: Toledo, OH, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to NomAnor
Default Drop down Box

Ok here is the deal, i have a page that our users can goto and it will list out all of the files that are contained in a set of folders. It works great and they all really like having access to the reports without having to have paper all over (paper bad). However as we have continued using it the page is getting VERY long and it takes a good deal of scrolling to get through the entire page. This has prompted my boss to ask if we can change it so that all of the reports that are in different folders will be listed in a drop down box so that a user would just have several drop down boxes in front of them, click the one for the report they want and then choose the report that they need. As i said the code below is working and does what it was intended to, however my efforts to modify it have not been at all successful so i was wondering if someone else has a take on it, i have italicized the part that i believe needs to be modified. Any suggestions are much appreciated.

<center><table class=middle_page>
    <center><span class=text>Welcome, To Reports Site.</span></center>

    <center><span class=text>You currently have access to these reports...</span></center>

        'section for viewing only links for current user...
        'session("location") = "1000"

        dim filesys, f 
        Set filesys = CreateObject("Scripting.FileSystemObject")

        Set f = filesys.GetFolder("c:\inetpub\wwwroot\reports\")

        'Response.Write ("Your folder was created on " & f.DateCreated)
        Set objfolders = f.subfolders

            for each objfolder in objfolders
                set objfolder1 = objfolders.item((objfolder.name))

                'if len(session("group")) > 0 then 
                        response.write "</table></center><center><table class=left_side><tr><td class=text>" & objfolder1.name & "</td><td class=text>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Available Links</td></tr>"

                        for each objfile in objfolder1.files
                            if instr(1,ucase(objfile),".PDF") or instr(1,ucase(objfile),".DWF") or instr(1,ucase(objfile),".EXE")  or instr(1,ucase(objfile),".HTM") or instr(1,ucase(objfile),".XLS") or instr(1,ucase(objfile),".ASP") or instr(1,ucase(objfile),".DOC") or instr(1,ucase(objfile),".XLS") then
                                response.write "<TR><TD>&nbsp;&nbsp;</TD><TD CLASS=INPUT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='REPORTS/"  & objfolder1.name & "/" & ucase(objfile.name)  & "' target='notes'>" &  ucase(objfile.name)  & "</a></TD></TR>"
                            end if
                        response.write "<BR>"
                'end if

                'exit for

Reply With Quote
  #2 (permalink)  
Old March 29th, 2004, 12:01 PM
Friend of Wrox
Join Date: Nov 2003
Location: Johannesburg, , South Africa.
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky


Why not create another page with the dropdowns that use FSO to read all the folders and add them to the list (Similar to how you reading the files) Once selected you pass the variable to the second page replacing the variabe as your root folder of the FSO.

e.g Set f = filesys.GetFolder("c:\inetpub\wwwroot\reports\") will become Set f = filesys.GetFolder("C:\" & SomeVArFromOtherPage)

This would probably be the quickest solution. Let me know if u need more information.
Reply With Quote
  #3 (permalink)  
Old March 29th, 2004, 12:21 PM
Friend of Wrox
Join Date: Nov 2003
Location: Johannesburg, , South Africa.
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky

You could also look at the last post in this topic: http://p2p.wrox.com/topic.asp?TOPIC_ID=6803

These 2 files (Browse.asp & Show.asp) will display folders as hyperlinks which links to the files.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dyamic Drop Down Box edwarjw Beginning PHP 1 August 16th, 2007 11:39 PM
drop down box selected value crmpicco HTML Code Clinic 1 March 31st, 2005 09:56 AM
drop down select box shoakat Classic ASP Databases 1 February 10th, 2005 04:42 AM
Search using drop down list box and a text box tcasp Classic ASP Basics 1 July 31st, 2003 02:58 PM

All times are GMT -4. The time now is 04:17 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.