asp.net ログインとユーザー登録を行う AccountController があります。(以下のアクションを登録します。成功した後、このユーザー データをユーザーと呼ばれる別のマインド テーブルに追加したいと思います。現在、「UsersController」と「Create」というアクションがあるため、以下に示すように、ライン:
return RedirectToAction("Create", "Users");
詳しい登録方法はこちら
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Register(string userName, string email, string password, string confirmPassword, string address, string address2, string city, string state, string homePhone, string cellPhone, string company)
{
ViewData["PasswordLength"] = MembershipService.MinPasswordLength;
if (ValidateRegistration(userName, email, password, confirmPassword))
{
// Attempt to register the user
MembershipCreateStatus createStatus = MembershipService.CreateUser(userName, password, email);
if (createStatus == MembershipCreateStatus.Success)
{
FormsAuth.SignIn(userName, false /* createPersistentCookie */);
return RedirectToAction("Create", "Users");
}
else
{
ModelState.AddModelError("_FORM", ErrorCodeToString(createStatus));
}
}
// If we got this far, something failed, redisplay form
return View();
}
私の問題は、すべての引数 (userName、email、address など) を自分のアクションに渡したいということです。これらは users テーブルのフィールドでもあるためです。
この他のアクションに引数を渡すにはどうすればよいですか、または一度に複数のアクションを実行して変数の状態を維持するための他の推奨される方法はありますか。