954,135 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Populate One Drop Down List From Another

Hi,

I have 2 drop down lists, in which the selection value of the 1st drop down list will determine the content of the second drop down list.
Is that I need to use javascript function to achieve this? If yes, how should I code the javascript and how should I call the javascript from within Page_Load, can someone please kindly show me an example?
Tour advice is much appreciated. Thanks.

wonder_gal
Newbie Poster
10 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

Do you know how to populate one combo?
If you don't i suggest that you read some tutorials before.

ManicCW
Junior Poster in Training
95 posts since Nov 2005
Reputation Points: 13
Solved Threads: 11
 

Ya of course I knew about populating one combo. My question here is how to populate the SECOND drop down list upon changes of selected value in the FIRST drop down list.

wonder_gal
Newbie Poster
10 posts since Apr 2007
Reputation Points: 10
Solved Threads: 0
 

Well just populate second dropdown in SelectedIndexChanged event of the first dropdown.

ManicCW
Junior Poster in Training
95 posts since Nov 2005
Reputation Points: 13
Solved Threads: 11
 
Well just populate second dropdown in SelectedIndexChanged event of the first dropdown.


then the page will go back to server to populate the dropdown list
i guess using AJAX is more efficient

w_3rabi
Junior Poster
160 posts since Dec 2006
Reputation Points: 18
Solved Threads: 9
 
then the page will go back to server to populate the dropdown list i guess using AJAX is more efficient

Sure it is.
But if she does not know how to populate this way it's going to be harder for her to do it ajax way.

ManicCW
Junior Poster in Training
95 posts since Nov 2005
Reputation Points: 13
Solved Threads: 11
 

surely

w_3rabi
Junior Poster
160 posts since Dec 2006
Reputation Points: 18
Solved Threads: 9
 

I have four dropdownlist boxes Each contains 1,2,3.....7 subitems.
I have filled first dropdown in page_init event by using
Me.ddlPickupNoOfDays1.Items.Add("1") .......Me.ddlPickupNoOfDays1.Items.Add("7") Now I want to fill remaining 3 dropdownlist boxes with same values And I dont want to write the same code in page_init event how can I fill remaining 3 dropdowns using first If someone knows please help

madhurimca
Newbie Poster
1 post since Dec 2009
Reputation Points: 10
Solved Threads: 0
 

Why u using this long way, why dont you edit items in dropdownlist properties, much easier, you dont have to write any code.
Hope this helps,

giahmed
Newbie Poster
19 posts since Dec 2009
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You