Why aren't you filling the dropDownList server-side, prior to delivery to the client?
I go into detail about the client-server nature of ASP.NET with these articles .
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
Yes, but, why? What I'm telling you is that this approach is unconventional. If you have enough information to fill the list when someone clicks it, you have enough information to fill it before it is clicked.
My suggestion is, the flaw is with your approach, not with the dropdownlist.
So again:
Why aren't you filling the dropDownList server-side, prior to delivery to the client?
You cannot fill the list client-side, unless the data to fill it is present client-side. How would the data be available? Only if you put it there, server-side. And if you can do that... why not just fill the list?
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
More time than it would take to fill them slowly, one at a time, with server round-trips throw in? NO WAY.
Plus, you can likely combine your queries to return all the results in a single recordset. You don't have to use a dataset, you can can do all your queries at page load, store the results someowere (dataset, arraylist, etc.) and bind that to your dropdowns.
Trust me: you cannot do this "client-side", because a client script cannot access a database, do a query, bind to a server-control, etc.
You can either code a JavaScript "submit()" to go fetch the data via server-side code, which is slower than just doing it in the first place, or you can code something using AJAX to retrieve the data (in ASP.NET they call it a "Script CallBack"), also slower than doing it upfront.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37