public ActionResult Register(RegisterModel model) { if (ModelState.IsValid) { if (model.Register(model) > 0) { FormsAuthentication.SetAuthCookie(model.UserName, false); return(RedirectToAction("Index", "Home")); } } // If we got this far, something failed, redisplay form return(View(model)); }
public virtual ActionResult Register(RegisterModel model) { if (ModelState.IsValid) { Status status; if(model.Register(out status)) return this.RedirectToAction<HomeController>(a => a.Index()); ModelState.AddModelError("Error", status.Message()); } else { ModelState.AddModelError("Error", "Please update the required fields"); } // Initialize the meta data information model = BaseModelHelper.GetRegisterModel(model); return View(model); }
public virtual ActionResult Register(RegisterModel model) { if (ModelState.IsValid) { Status status; if (model.Register(out status)) { return(this.RedirectToAction <HomeController>(a => a.Index())); } ModelState.AddModelError("Error", status.Message()); } else { ModelState.AddModelError("Error", "Please update the required fields"); } // Initialize the meta data information model = BaseModelHelper.GetRegisterModel(model); return(View(model)); }