Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 6th, 2003, 07:27 AM
Authorized User
 
Join Date: Jun 2003
Location: Aalst, Vlaanderen, Belgium.
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic Menu - Using multiple dropdown boxes

Hi,

I was wondering whether someone could help me with the following :

At works I saw an application using JavaScript to create dynamic menus. Based on the selection in the first <SELECT> box, the second <SELECT> box was created with associated values. Everytime that it got new information, there was a request back to the server without [that is what it seemed to do] refreshing the page. So, the page was left with the old contents and <SELECT> boxes were added with fresh data. I checked the JavaScript code and it seemed pretty advanced. However the technique used is quiute simple. The old page stays the same, but the <SELECT> boxes get updated by requesting new info. If you make a choice in the first box, you can clearly see the progress bar in the IE window at the bottom.

So what I would like to do is :

[All data is held in an MS ACCESS or SQL 2000 Database]

- create a form on a page with in the first select box the country name [eg. Belgium, UK, France, ... located in the coutnry table of the DB]
- the second box is not displayed as long as nothing is selected in the first box. It will hold the cities of that particular country [eg. Brussels, London, Paris, ... located in the cities table of the DB]

The difficult part : THE PAGE MAY NOT SEEM TO RELOAD AT ALL.

The database access would go through ASP.

I already tried making something similar by putting all data in an array, putting the array in different SELECT boxes and to hide/show them using Cascading Style Sheets. However, there is still no limit in tranfsfer to the server, and it will take all data from the database and load it in memory.

Can someone please help me out ? Does this all make sense ?

If so, you can still come over to Belgium, I'll buy you a fresh, nice beer !

Sebastiaan.
Reply With Quote
  #2 (permalink)  
Old June 6th, 2003, 09:36 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Sebastiaan,

There are a few ways to overcome this problem. I won't give you any specific code, just general ideas. Depending on the option you choose, I could post further information here.

1. Smart Navigation. This is something that comes with ASP.NET and works for IE browsers only. Basically it provides for some smart UI updating / scrolling so the website looks more like a desktop app. You could look into the code supplied with the .NET framework for ideas.

2. Client side caching. Depending on the dynamic nature of your data you could retrive ALL information, store them in local .js files and use that info to build your lists dynamically. This may be a good option for country / state lists, as the number of items is rather limited.

3. Frames. You can use an (inline) frame to hold the drop down lists and nothing else. This way, you can requery new data without refreshing the whole page. The disadvantage of this however, is that it's harder to retrieve the info from the iframe than it is from other controls in your form.

4. Active X. Yak

5. Hidden frames. There are ways to requery the data in a hidden frame, and use the results for your drop downs. This way you can refresh the data without updating the screen.

There may be other ways as well, but this is all I can come up with on a Friday afternoon.

Cheers,

Imar

P.S. If you like one of the options; I'll be in Belgium in June for the Werchter festival....... ;)
Reply With Quote
  #3 (permalink)  
Old June 6th, 2003, 05:33 PM
Authorized User
 
Join Date: Jun 2003
Location: Aalst, Vlaanderen, Belgium.
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Vriendelijk dank Imar voor de verschillende opties, ActiveX zat ik al een tijdje aan te denken, Frames liever niet [maak de pagina weer een stuk lastiger voor de browser], ASP.NET is iets te vroeg om die weg te bewandelen, het zal de tweede optie worden denk ik !

Een goei pint hebt ge beslist verdiend, maar helaas ga ik niet naar Werchter dit jaar. Misschien Pukkelpop ?
Reply With Quote
  #4 (permalink)  
Old June 7th, 2003, 06:38 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You're welcome. Option 2 would have been my choice as well.

Good luck building it.

Cheers,

Imar
Reply With Quote
Reply


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
Dynamic Menus - Using multiple dropdown boxes Sebastiaan ASP.NET 1.0 and 1.1 Basics 1 April 18th, 2007 06:25 AM
Javascript Dynamic dropdown Menu itHighway Javascript How-To 0 July 24th, 2005 10:53 PM
Dynamic Menu - Using multiple dropdown boxes Sebastiaan Javascript How-To 2 December 1st, 2003 05:36 AM
dynamic dropdown boxes fmh002 Classic ASP Basics 1 June 26th, 2003 08:35 PM



All times are GMT -4. The time now is 01:55 AM.


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