I have 2 linked database tables (Similar to Country -> State) – how can I dynamically populate 2 drop down lists with these tables such that:
If I pick a Country, only the states for that country show up in the second drop down list?
Update:
There seems to be a solution on this page -> Populate DropdownList based upon other DropDownList VB -> the one that uses the SQL Data connection on the aspx page itself, databinding the dropdowns – how do I do this with LINQ? I think I can figure it out from here.
You have your state control hidden, and autopostback = true on your Country dropdownlist.
On the SelectedIndexChanged, you pull that value and query your database with that, and then set your state drop down list to visible.
In the ASPX page:
In the Code Behind: