Reputation: 309
What I want to do is make a dropdownlist choices change depending on other dropdownlists on the page. What I did is write all the possibilities in hidden textboxes. This works, but when there are a lot of choices, the page is slow.
Is there a better way to do this?
Thank you for your time
Upvotes: 0
Views: 865
Reputation: 66399
AJAX is the way to go as indicated by all others, you can save yourself time by using code that others already written, for example: http://www.codeproject.com/KB/custom-controls/ajaxdropdownlist.aspx
This one is pretty old by now but can at least show you what you need.
Upvotes: 0
Reputation: 47183
I'll present one possible scenario.
Upvotes: 0
Reputation: 4259
As laurencek says AJAX would be end solution for this. On asp.net, there is a good sample provided with a understandable explanation, here. A little use of Web Service that might cause some pause but still a good explanation on what you are looking for.
Upvotes: 0
Reputation: 10064
It can be done using some of the available ASP.Net AJAX techniques. If you place the dropdown listboxes in an UpdatePanel
and set them to asynchronous postback, you can make them appear to refresh on selection.
Because only the code inside the UpdatePanel
is refreshed, the results are loaded much faster.
See this article for a nice example using the updatepanel and a couple of dropdown lists.
Upvotes: 1
Reputation: 10718
The best way to do this is with AJAX. In summary you will need to:
Upvotes: 2