public virtual ActionResult Register()
        {
            var model = new viewModels.RegisterViewModel()
            {
                RequireSecretQuestionAndAnswer = membershipService.RequiresQuestionAndAnswer
            };

            return(ContextDependentView(model));
        }
        public virtual ActionResult CreateUser(viewModels.RegisterViewModel model)
        {
            MembershipUser         user;
            MembershipCreateStatus status;

            user = membershipService.CreateUser(model.UserName, model.Password, model.Email, model.SecretQuestion, model.SecretAnswer, model.Approve, out status);

            return(routeHelpers.Actions.GrantRolesToUser(user.UserName));
        }
        public virtual ActionResult CreateUser()
        {
            var model = new viewModels.RegisterViewModel()
            {
                RequireSecretQuestionAndAnswer = membershipService.RequiresQuestionAndAnswer
            };

            return(View(model));
        }
        public virtual ActionResult Register(viewModels.RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                // Attempt to register the user
                MembershipCreateStatus createStatus;
                membershipService.CreateUser(model.UserName, model.Password, model.Email, model.SecretQuestion, model.SecretAnswer, true, out createStatus);

                if (createStatus == MembershipCreateStatus.Success)
                {
                    formsAuthenticationService.SetAuthCookie(model.UserName, false /* createPersistentCookie */);
                    return(RedirectToAction("Index", "Home"));
                }
                else
                {
                    ModelState.AddModelError("", ErrorCodeToString(createStatus));
                }
            }

            return(RedirectToAction("Register"));
        }
        public JsonResult JsonRegister(viewModels.RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                // Attempt to register the user
                MembershipCreateStatus createStatus;
                membershipService.CreateUser(model.UserName, model.Password, model.Email, model.SecretQuestion, model.SecretAnswer, true, out createStatus);

                if (createStatus == MembershipCreateStatus.Success)
                {
                    formsAuthenticationService.SetAuthCookie(model.UserName, false);

                    return(Json(new { success = true }));
                }
                else
                {
                    ModelState.AddModelError("", ErrorCodeToString(createStatus));
                }
            }

            return(Json(new { errors = GetErrorsFromModelState() }));
        }
 public virtual ActionResult CreateUser()
 {
     var model = new viewModels.RegisterViewModel()
     {
         RequireSecretQuestionAndAnswer = membershipService.RequiresQuestionAndAnswer
     };
     return View(model);
 }
 public virtual ActionResult Register()
 {
     var model = new viewModels.RegisterViewModel()
     {
         RequireSecretQuestionAndAnswer = membershipService.RequiresQuestionAndAnswer
     };
     return ContextDependentView(model);
 }