if (ModelState.IsValid) { MembershipCreateStatus membershipCreateStatus; Membership.CreateUser(userRegistration.userName, userRegistration.password, userRegistration.emailID, userRegistration.securityQuestion, userRegistration.securityAnswer, true, out membershipCreateStatus); if (membershipCreateStatus == MembershipCreateStatus.Success) { Roles.AddUserToRole(userRegistration.userName, "UserRole"); return RedirectToAction("Index", "Account"); } else { ModelState.AddModelError("", "Registration Unsuccessful, Please Try again"); return View(userRegistration); } } else { return View(userRegistration); }
Saturday, February 9, 2013
Create User In MVC Membership
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment