public ActionResult Register() { DAL_Roles dal_roles = new DAL_Roles(); ViewBag.UserType = new SelectList(dal_roles.AllRoles()); return(View()); }
public ActionResult Register(UserProfile UP) { DataAccessLayer dal = new DataAccessLayer(); int rows = dal.AddUser3(UP); if (rows != 0) { return(RedirectToAction("Login", new { controller = "Account", action = "Login", id = UrlParameter.Optional })); } else { DAL_Roles dal_roles = new DAL_Roles(); ViewBag.UserType = new SelectList(dal_roles.AllRoles()); return(View(UP)); } }