Click here to Skip to main content
15,920,217 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In my work , a particular webform consist two dropdownlist whose IDs are respectively "DepartFrom" and "DepartTo". Each list consist the same text items. Texts are "Dhaka, Chittagong, Sylhet, Cox'sbazar".

Now I want to action as follows :

1. When I select "Dhaka" in "DepartFrom" list it will not appear in the "DepartTo" list, but the others will.
2. When I select 'Text' except 'Dhaka' in 'DepartFrom' list, only 'Dhaka' will appear in the "DepartTo" list.

It will be better for me to get feedback in C#.
Posted
Comments
José Amílcar Casimiro 19-Apr-13 16:28pm    
I will help you with c# as soon you make a question.
joshrduncan2012 19-Apr-13 16:29pm    
I agree. Also, we need to see what effort has been made on the OP's part first.

1 solution

Hello Sopner Feriwala

I Higly recommend you to take a look at this:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.dropdownlist.aspx

Read about the following events:
SelectedIndexChanged
TextChanged

Instead of basing conditions in Text Item, I recommend you basing on Text Value. Because values remain practically unchanged, however, the text may change frequently.

If you still have any other question, please fell free to ask.

Best Regards.
 
Share this answer
 
Comments
Richard C Bishop 19-Apr-13 16:56pm    
Nice answer. That should hopefully turn on the logic light-bulb for the OP. +5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900