Jeff Forde

Jeff Forde

  • NA
  • 1
  • 851

Need help with MVC Cascading Dropdown Lists

Aug 22 2014 11:44 AM
I'm interfacing with and API that returns a complex JSON object that I want to create a dynamic cascading dropdown list from. I've got it pretty well figured out how to do if I was using straight angularJS to do the filtering, However I cannot figure out how to get this to work in the MVC framework using the @html.dropdownlistfor. 
 
Example JS Plunk:
http://plnkr.co/edit/WTkZqCq3Evr4BSidjg54?p=preview
 
Currently hitting the API from the Controller and passing that json in the view data to the view
string vmWareConfigs = JsonHelper.DownloadJson("/VmWare");
ViewData["vmWareConfigs"] = vmWareConfigs;
 
In the view I then want to use AngularJS to walk the json and filter/fill the @html.dropdownlistfor
 
Is this possible?