简体   繁体   中英

Mark items in Listbox 2 from selection in ListBox 1

I have two ListBox with some items in each. I have three tables, lets say, company, employee, company_employee

I populate the first ListBox with the company, second ListBox with employee. What I want is to select a company and when I do that, select what employee's that are connected to that company.

How can I do this with asp.net MVC 4? I thought of a ajax-solution to get the records in company_employee depending on my first listbox selection id, but im not sure how to do this with asp.net.

Any suggestions to lead me forward?

Best regards,

me.

Use a jquery event triggered on a change of your first listbox that calls a webservice that will return a custom collection(employees) of type employee, this method will take in the country id perhaps . Bind that collection to a control. If you're expecting it all on a plate sorry but that is the way forward you can break this down and learn how to do each step.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM