Click here to Skip to main content
15,915,086 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,


I have a problem of selectedindexchanged of a dropdownlist.I am using two dropdownlist and want to show data in them from database sqlserver.So,I want to get value on second dropdownlist on selectedindexchanged on first dropdownlist,but its not working.Can i do this by a simple javascript???

Please give Me a solution about this.

Thanks.
Posted
Comments
ythisbug 16-Feb-12 4:17am    
hi u mean to say u want to get records from database to dropdowns?

1 solution

Please follow this steps..

1) first of all you need to add one property to your first drop down
AutoPostback = true

2) now you need to set your selectedindexchange event of your first drop down

3) in selected index change event writer your code fro data binding for your second dropdwon as per the first dropdwon selected value or in-case selecteditems.text

4) this way you can perform your corresponding data binding of two drop downs...
 
Share this answer
 

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