NET & Web Development Synchronized Drop Down Lists By Don Kiely Sometimes it amazes me just how hard some stuff is in ASP. For a technology that makes so many things so easy, too much is still just too dang hard. I had a requirement in a website for entering demographic information for a customer.(This is for a back-end database-maintenance application, not a public-facing site.) Although the vast majority of our customers are in the United States and Canada, we have a growing list of international customers and need flexibility in how the people who maintain the data enter address information.This is because there seems to be no way to bind the list of regions before that selected value gets bound.If you try, you'll end up with an error message that the value you are binding Selected Value to doesn't exist in the list.I want both buttons to update the data source but the 'OK' button should redirect afterwards.I can see which button is clicked in the Item Command event but I can't redirect from here because the Item Updated event hasn't fired yet.Here's my code: Nothing special or hard there, so far.
Remember that we couldn't bind the Region ID value in the item data bound to the parent List View. The Item Data Bound event of the List View has to do two things.It, too, is bound to a Sql Data Source for the list of regions, with the Select Command using a @Country ID parameter.But that parameter is not bound to the Country Drop Down List because of all the bad things that happen when you try to bind them together.I can put a variable in the code-behind class which is gets the Command Argument in the Item Command event and then read it in the Item Updated event but this doesn't seem to follow the event model concept very well.Is there a better or more appropriate technique I could use?