Solved

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

Posted on 2009-07-07
4
459 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Awesome Website-- It was more than I was looking for.. thanks!!!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

762 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

11 Experts available now in Live!

Get 1:1 Help Now