Solved

How to auto populate a second dropdown list from a previous selection on the first dropdown list?

Posted on 2009-07-07
4
461 Views
Last Modified: 2012-05-07
Im trying to create a form that will have several dropdown lists. When a user chooses and option on the first dropdown list, it will populate the second dropdown with options related to the selection on the first dropdown list. Im new to .net and I dont know how to go about it.
0
Comment
Question by:jhsit
4 Comments
 
LVL 41

Expert Comment

by:guru_sami
ID: 24799031
Key is to use SelectedIndexChanged event on first DropDownList and appropriately binding the next DDL..
See this example:
http://www.aspsnippets.com/post/2009/06/13/Creating-Cascading-DropDownLists-in-ASPNet.aspx
0
 
LVL 21

Accepted Solution

by:
Tapan Pattanaik earned 500 total points
ID: 24799057
hi jhsit,

           Use ASP.NET AJAX CascadingDropDown Control Extender. Check the below link which describes about that.

http://www.asp.net/AJAX/AjaxControlToolkit/Samples/CascadingDropDown/CascadingDropDown.aspx

Here is a video tutorial for AJAX CascadingDropDown Control Extender

http://www.asp.net/learn/ajax-videos/video-77.aspx

Thanks
0
 
LVL 8

Expert Comment

by:MrAgile
ID: 24799401
HI There,

I would try to steer away from using MS ajax in my applications if I were you. The library is massive and adds to much weight and code to your page.

What you need can be achieved using a javascript framework like (www.jquery.com). Here is a sample of dependant dropdowns that can be adapted to what you're doing.

http://www.ajaxray.com/blog/2007/11/08/jquery-controlled-dependent-or-cascading-select-list-2/ 

There are also more samples on the web or if need be I can help you with some basic code.

Sean
0
 

Author Closing Comment

by:jhsit
ID: 31602202
Awesome Website-- It was more than I was looking for.. thanks!!!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

832 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