public void PopulateDealerUserList(ref DropDownList dropDownList) { dropDownList.Items.Clear(); var groupList = IssueDao.GetDealerUserList(); dropDownList.Items.Add(new ListItem(string.Empty, "0")); foreach (var g in groupList) { dropDownList.Items.Add(new ListItem(g.UserName, g.Id)); } }
public List <System.Web.Mvc.SelectListItem> PopulateDealerUserList() { var list = IssueDao.GetDealerUserList(); var query = (from i in list select new SelectListItem { Text = i.UserName, Value = i.Id }).ToList(); return(query); }