Skip to content
Loading

And in the end of the view, this is my JS section:

  1. "~/js/jquery-3.2.1.min.js">  
  2.   
 

This section calls this action:

Code
  1.     public JsonResult GetDistrictList(int DepartmentID)  
  2. {  
  3.     List DistrictList = _context.Districts.Where(x => x.DepartmentID == DepartmentID).ToList();  
  4.     return Json(DistrictList);  
  5. }  
Code

And that's it.

When I run the application, well, the District dropdownlist don't populate

_Questions:

Thanks in advance for any help.

Regards,

_Update:

I put a break point on this line, inside the JsonResult:

Code
List DistrictList = _context.Districts.
      Where(x => x.DepartmentID == DepartmentID).ToList();

But the application did not stopped there when I used the Department dropdownlist that is supossed to call that JsonResult. I believe the script section is what might be wrong.