Solved

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

Posted on 2009-07-07
4
464 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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