I have 4 table relation in sql server database is good
Country table
Id primarykey increment identity
Countryname
City table
Id primary key increment identity
Cityname
CountryId forignkey
Ditrict table
Districtname
CityId forignkey
Employee table
fname
sname
salary
Bonus
districtid forignkey
Relation not have any proplem
when select items from country it fill city drop down list without any problem
but when i select item from city it not fill items in district why
something wrong in my code i do as following
my controller employee as following
EmployeeController
public class EmployeeController : Controller { // GET: Employee mytaskdbEntities db = new mytaskdbEntities(); public ActionResult Index() { return View(db.Employees.ToList()); } public ActionResult Create() { ViewBag.CountryList = new SelectList(db.Countries.ToList(), "Id","Countryname"); return View(); } public JsonResult getcitybyid(int id) { db.Configuration.ProxyCreationEnabled = false; return Json(db.Cities.Where(a =>a.CountryId == id), JsonRequestBehavior.AllowGet); } public JsonResult getdistrictbyid(int id) { db.Configuration.ProxyCreationEnabled = false; return Json(db.Districts.Where(a => a.CityId == id), JsonRequestBehavior.AllowGet); } } }