views:

27

answers:

1

I have a web page with two dropdowns in formview. I want to change items in the second dropdown when the user selects an item in the first dropdown.

+1  A: 

Add a SelectedIndexChanged event on the first dropdown and then, in that event's code, bind the second one. Also, you have to set AutoPostBack="True" on your first dropdown.

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listcontrol.onselectedindexchanged.aspx

You might also want to put the two dropdowns inside an UpdatePanel, to avoid posting the entire page each time.

Dan Dumitru