public ActionResult tres() { var country = serviceCountry.GetMany().ToList(); List <SelectListItem> li = new List <SelectListItem>(); li.Add(new SelectListItem { Text = "--Select Country--", Value = "0" }); foreach (var m in country) { li.Add(new SelectListItem { Text = m.CountryName, Value = m.CountryID.ToString() }); ViewBag.country = li; } return(View()); }
// GET: Countries public ActionResult Countries() { var co = serviceCountry.GetMany().ToList(); return(View(co)); }