コード例 #1
0
 public ActionResult FillDropdownbox()
 {
     try
     {
         ds = mdb_layer.Bind_MultipleColumnDropdown();
         ViewBag.Resignation = ds.Tables[0];
         List <SelectListItem> ResignationList = new List <SelectListItem>();
         foreach (DataRow dr in ViewBag.Resignation.Rows)
         {
             ResignationList.Add(new SelectListItem {
                 Text = dr["CombinedData"].ToString(), Value = dr["emp_id"].ToString()
             });
         }
         ViewBag.ResignationType = ResignationList;
         return(View());
     }
     catch (Exception ex)
     {
     }
     return(View());
 }