public ActionResult GetStateList(string Country) { PageVM pageObj = new PageVM(); List<State> stateCollection = new List<State>(); for (int i = 0; i < 10; i++) { stateCollection.Add(new State { StateName = "State" + i, Id = i }); } pageObj.StateCollection = stateCollection; pageObj.SelectedState = "State3"; return Json(pageObj,JsonRequestBehavior.AllowGet); }
// // GET: /Home/ public ActionResult Index() { PageVM pageObj = new PageVM(); List<Country> countryCollection = new List<Country>(); for (int i = 0; i < 10; i++) { countryCollection.Add(new Country { CountryName = "Country" + i, Id = i }); } pageObj.CountryCollection = countryCollection; pageObj.SelectedCountry = "Country3"; pageObj.SelectedState = "State3"; pageObj.SelectedCity = "City3"; return View(pageObj); }