public IActionResult Register(RegisterViewModel rvm) { if (ModelState.IsValid) { var user = _svc.Register( rvm.EmailAddress, rvm.Name, rvm.GetRole(), rvm.Password, _Csvc.GetCity(rvm.CityID) ); if (user != null) { Alert("User \"" + user.EmailAddress + "\" Created.", AlertType.success); return(RedirectToAction("AdminHome", "Home")); } } Alert("Oh. Something wasn't right there.", AlertType.warning); // Repopulate Selectlist var Cities = _Csvc.GetCities(); rvm.Cities = new SelectList(Cities, "CityID", "Name"); return(View(rvm)); }