コード例 #1
0
 public ActionResult Index8(int? Id)
 {
     //initial id
     Id = 1;
     StateData statData = new StateData();
     StateDisplayModel cntry = statData.stateDisplaytList();
     //var cntry = stateList.Where(s => s.StateID == Id).FirstOrDefault();
     //get all instead
     return View(cntry);
 }
コード例 #2
0
 public StateDisplayModel stateDisplaytList()
 {
     CountryModel sdm1 = new CountryModel { Countryname = "USA", StateID = 1, StateName = "Arizona" };
     CountryModel sdm2 = new CountryModel { Countryname = "France", StateID = 2, StateName = "FranceCity" };
     CountryModel sdm3 = new CountryModel { Countryname = "Germany", StateID = 3, StateName = "GermanyCity" };
     StateDisplayModel sdm = new StateDisplayModel();
     sdm.CountryModel = new List<CountryModel>
     {
         sdm1,
         sdm2,
         sdm3
     };
     return sdm;
 }
コード例 #3
0
 public ActionResult Index8(StateDisplayModel sdm)
 {
     //put a breakpoint here to see selected item
     var q = sdm.SelectedCountry;
     return View();
 }