Cascading DropDownLists Question (non-Ajax)

D

Don Miller

I have one databound DDL (Categories) in a web form and when an item is
selected (SelectedIndexChanged) I want to populate a second DDL
(SubCategories). It was fairly easy to get this to work out of the box, but
I'm stumped on how to append the appropriate dummy text items (All
Subcategories or No Subcategories Found) at the top of the second DDL. In
other words, in what part of the script (or event) can I programmatically
find out whether the second DDL had multiple subcategories (returned more
than 0 items) or none (returned no items) in order to append the appropriate
item text at the top of the list (or maybe even hide the second DDL if there
were no results)?

This would seem to be a fairly common requirement but I cannot find examples
of how to test whether the second DDL returns results or not. Could someone
please refer me to a good example of how this is done, or pseudo-code to get
me started?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top