Example #1
0
 public virtual ActionResult Create()
 {
     var membershipUser = new CreateMembershipUserModel()
     {
         IsApproved = true
     };
     return View(membershipUser);
 }
Example #2
0
 public virtual ActionResult Create(CreateMembershipUserModel model, string @return)
 {
     JsonResultData data = new JsonResultData();
     if (ModelState.IsValid)
     {
         data.RunWithTry((resultData) =>
         {
             try
             {
                 _manager.Create(Membership, model.UserName, model.Email, model.Password, model.IsApproved, model.Culture, model.TimeZoneId, model.PasswordQuestion, model.PasswordAnswer
                 , model.MembershipGroups, model.Profiles, model.Comment);
                 resultData.RedirectUrl = @return;
             }
             catch (DataViolationException dataViolationException)
             {
                 ModelState.FillDataViolation(dataViolationException.Violations);
             }
         });
     }
     data.AddModelState(ModelState);
     return Json(data);
 }