public PartialViewResult _LoadDanhSachTheoLoai(int?TheloaiId) { TheLoaiService service = new TheLoaiService(); ViewBag._LoadDanhSachTheoLoai = new SelectList(service.DSTheLoai(), "TheLoadId", "TenTheLoai", TheloaiId); return(PartialView("_LoadDanhSachTheLoai")); }
public JsonResult _LoadDanhSachTheLoai(int?TheLoaiId) { TheLoaiService _service = new TheLoaiService(); var data = _service.DSTheLoai(); return(Json( data.Select(x => new { text = x.TenTheLoai, id = x.TheLoadId, selected = TheLoaiId == x.TheLoadId }).ToList() , JsonRequestBehavior.AllowGet)); }