public ActionResult LoadCountriesList() { var model = new CascadingDropdownViewModel(); model = model.LoadModel(); _countries = model.AllCountries; if (HttpContext.Request.IsAjaxRequest()) { return(Json(new SelectList( _countries, "Id", "Description"), JsonRequestBehavior.AllowGet )); } return(null); }
public ActionResult LoadTownList(int id) { var model = new CascadingDropdownViewModel(); model = model.LoadModel(); _towns = model.AllTowns.Where(x => x.StateId == id).ToList(); if (HttpContext.Request.IsAjaxRequest()) { return(Json(new SelectList( _towns, "Id", "Description"), JsonRequestBehavior.AllowGet )); } return(null); }
public ActionResult Index() { var model = new CascadingDropdownViewModel(); return(View(model.LoadModel())); }