Cascading dropdownlists not working in the edit template of detailsview
I ran into this problem: I came acrossed a requirement where by I had to use two dropdownlist controls in a
detailsview control. Additional requirement was that data in the second dropdownlist control was based on the
selection of data from the first dropdownlist control. For example I have two tables States and Cities. Based on
selected state the corresponding cities of that state should be filled in the second dropdownlist control.
Steps:
1. Create a DetailsView, bind it to some data table
2. Convert one bound field (ex. fieldA) into Template field
3. Edit template, in the EditItemTemplate, drag a DropDownList (ex. DDL1), set its datasource to SQL data source
object (table States)
4. Convert another bound field (ex. fieldB) in to Template field
5. Edit template, in the EditItemTemplate, drag another DropDownList (ex. DDL2), set its datasource to SQL data
source object (table Cities) with some select parameter (from DDL1)
6. Run the application
7. Select some item and press "Edit", then select any other list item in DDL1
Expected Results:
DDL2 should map the corresponding item and no error occurs: based on selected state the corresponding cities of
that state should be filled in the second dropdownlist control
Actual Results
The web application aborts and the exception message pops up in the VS2005 /VS2008 IDE.
Anyone can help me to solve this problem please.
|