Automatically Reload after Drop Down box

P

pmelanso

Hello,
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"
</asp:dropdownlist>

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

Pam
 
S

S. Justin Gengo

Pam,

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.



--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top