Automatically Reload after Drop Down box



I have a drop down list which is dynatically loaded from a database and
I have a second drop down list that is also dynatically loaded
depending on what is selected in the first drop down box. This all
works fine ... what isn't working is when I selected a different item
in the first drop down list I want it to automatically reload the items
in the second drop down list.

I have a funcation called loadNames that laod the second drop down
list. and I tried doing it so that function is called :

<asp:dropdownlist id="Departments" runat="server"
DataTextField="Department" DataValueField="Department"
AutoPostBack="True" OnSelectedIndexChanged="loadNames"

but it doesn't work... it will only reload the second drop down box
when I click a button.




S. Justin Gengo


OnSelectedIndexChanged from the drop down's code in the display page is
attempting to call a javascript called loadNames.

Instead go to the code behind and call loadNames from the first drop down
list's post back event handler.


S. Justin Gengo, MCP
Web Developer / Programmer

"Out of chaos comes order."

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