Solved

Cascading DropDownList Controls

Posted on 2011-09-28
11
600 Views
Last Modified: 2012-06-27
Hello Experts,

I have a web application that will be for enrollment for a college. Please see the Steps below in the order that I need the values to appear in the multiple DropDownList Controls.

STEP 1: Select State:
STEP 2: Select City
STEP 3: Select County
STEP 4: Select ZIP

So all controls will need to interact with each other starting from the DropDownList Control in STEP 1 to STEP 4.

I would prefer to NOT have the page PostBack for every DropDownList Selected. I would prefer to use AJAX for ASP.NET if possible.

Also, all the values for each STEP will be in the Database and will need to be ALL related to each other some how and will need to be pulled from the Database. I also plan on using a DataSet with multipe DataTables or one DataTable. What do you prefer I use for storing/retrieving the data??

Thanks in advance!!!
0
Comment
Question by:asp_net2
  • 3
  • 3
  • 2
  • +1
11 Comments
 
LVL 21

Expert Comment

by:Tapan Pattanaik
Comment Utility
hi asp_net2,

Please check this link. Here is answer to your question.

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/CascadingDropDown/CascadingDropDown.aspx

thanks.
0
 
LVL 18

Expert Comment

by:nap0leon
Comment Utility
There are a variety of AJAX libraries out there you can use... I presume you already have a library or method in mind and you already have a webpage built that retrieves the data for the input passed in - it returns a list of cities for any STATE that is passed in).

To add this to your page, add an "onChange" function for each drop-down.

State_onChange should use AJAX call to get your City list and then populate the City drop-down list
City_onChange should use AJAX to fetch and populate County list
County_onChange should use AJAX to fetch and populate ZIP list

To handle cases where a user selects values for all then changes STATE, in your AJAX parsing, be sure to accommodate "blank" being passed in so that when State_onChange populates the City list, since the city will initially be blank, the County should be reset to blank which in turn resets ZIP to blank.
0
 
LVL 21

Accepted Solution

by:
Tapan Pattanaik earned 500 total points
Comment Utility
0
 
LVL 4

Author Comment

by:asp_net2
Comment Utility
@tapanpattanaik,

Can you take a look at this article below and give me your thoughts on their process and most importantly the performance between this one below and using a webservice? To me I would think using a webservice but be slower. I like the method on the article below but not sure how I could increase the performance if I have 100,000 users +.

http://www.aspsnippets.com/Articles/Creating-Cascading-DropDownLists-in-ASP.Net.aspx

0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
I have personally used this jQuery  control. It uses ajax to retrieve the cascading values:
http://plugins.jquery.com/project/optiontree
demo: http://blog.kotowicz.net/2009/03/jquery-optiontree-demo.html

I use it in several PHP pages and it can be used in ASP.net. I wrote a GoogleBase taxonomy selector using this and it has up to 8 levels with over 3000 options.
0
 
LVL 4

Author Comment

by:asp_net2
Comment Utility
@EddieShipman,

My question has to do with interaction to DB and your doesn't mention anything about DB.
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
No, but the control I mentioned uses ajax to obtain values for the second, third, etc drop downs. You would have to write your own scripts to retrieve the values based on your schema.
0
 
LVL 4

Author Comment

by:asp_net2
Comment Utility
@EddieShipman,

Do you have any tutorials that deal with AJAX using ADO.NET to retrieve data to multiple DropDownList Controls? Also, please no Webservice methods either.
0
 
LVL 26

Expert Comment

by:EddieShipman
Comment Utility
Coming from PHP, I can't really explain how to use ajax with ASP.Net. I would think that a regular ASP.Net page with ADO.Net objects retrieving the data and writing it out as JSON would suffice.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now