public ActionResult DeleteUser(FormCollection frm) { if (Session["loginDetails"] != null) { TempData["LoginId"] = user_Id; string user_id = frm["ddluser"].ToString(); SuperAdminBLL bll = new SuperAdminBLL(); List<string> lst = bll.GetUserID("2", user_id); if (lst.Contains("Delete")) { return RedirectToAction("DeleteUser"); } return View(); } else { return RedirectToAction("Error"); } }
public ActionResult DeleteUser() { if (Session["loginDetails"] != null) { TempData["LoginId"] = user_Id; SuperAdminBLL bll = new SuperAdminBLL(); List<string> lst = bll.GetUserID("1"); List<SelectListItem> slst = new List<SelectListItem>(); foreach (string item in lst) { slst.Add(new SelectListItem { Text = item, Value = item }); } ViewBag.DropDown = new SelectList(lst); return View(); } else { return RedirectToAction("Error"); } }