当我使用注册新用户时
Membership.CreateUser(model.UserId, model.Password, model.Email, null, null, true, null, out createStatus)
我收到以下错误:
不支持指定的方法
请帮忙
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public ActionResult Register(RegisterModel model)
{
if (ModelState.IsValid)
{
// Attempt to register the user
MembershipCreateStatus createStatus;
Membership.CreateUser(model.UserId,
model.Password,
model.Email,
null,
null,
true,
null,
out createStatus);
if (createStatus == MembershipCreateStatus.Success)
{
UpdateUserInfo();
/* "False" for createPersistentCookie: */
FormsAuthentication.SetAuthCookie(model.UserId, false);
return RedirectToAction("Index", "Home");
}
else
{
ModelState.AddModelError("", ErrorCodeToString(createStatus));
}
}
// If we got this far, something failed, redisplay form
return View(model);
}