I've been going back and forth on whether to query a database for data on the client side or the code behind and I'm wondering if anyone has any info on the best way and possibly examples.
This is what I'm wanting to do:
I have a list box of columns that the user can select and 2 dropdown objects.
I want the selected values from the list box to populate in 1st dropdown.
The user selects the column he wants, and the second dropdown (which I'm trying to make a multi-select dropdown but haven't found a good example that I can get working) to populate with values from a table based on the 1st dropdown selection.
So,
Listbox selected values --> Dropdown1
Dropdown1 selected value becomes parameter for a query to the database to return values for the 1st dropdown.
----
2nd:
There is another set of dropdowns that are populated with the same listbox values. but, when the user selects a value in the 1st dropdown, I want it to disappear in the 2nd set of dropdowns so they can't see it or choose it 2ce.
This is where I thought client-side querying would be better than making calls back to the server for each set of dropdowns.
I currently have client-side scripting populating the selected listbox values into the dropdown boxes but I'm afraid when I do a post-back, they will disappear unless I put them into their own update panel?
Is this confusing or make sense? Also, I'm not using AJAX but as I'm writing this, that might be a good alternative too. I haven't done ASP work in a long time and I'm rusty so when I tried to work with it, I had problems.
If I can get suggestions without AJAX, that would be helpful.