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
The best way to do this is with AJAX. In summary you will need to:
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.
I'll present one possible scenario.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.