public void listThanhpho(string selected) { List <Thanhpho> thanhpho = _thanhphoRepository.ListThanhpho().ToList(); var empty = new Thanhpho { Matp = "", Tentp = "-- Chưa có thông tin --" }; thanhpho.Insert(0, empty); ViewBag.thanhpho = new SelectList(thanhpho, "Matp", "Tentp", selected); }
public void listThanhpho(string selected) { List <Thanhpho> thanhpho = _thanhphoRepository.ListThanhpho().ToList(); ViewBag.thanhpho = new SelectList(thanhpho, "Tentp", "Tentp", selected); }