Solved

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

Posted on 2009-07-07
4
463 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

680 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