public ActionResult Customers() { List <Customer> custList = customerDataService.Get(); Common common = new Common(); common.Customers = custList; common.Countries = GetCountryList(); ViewBag.SelectedCountryId = common.Countries[0].Id; var selectedCountryName = Convert.ToString(TempData["SelectedCountry"]); if (!String.IsNullOrEmpty(selectedCountryName)) { ViewBag.Selected = selectedCountryName; common.Customers = custList.Where(c => c.Address == selectedCountryName).ToList(); ViewBag.SelectedCountryId = common.Countries.Where(x => x.Name == selectedCountryName).FirstOrDefault().Id; } return(View(common)); }