私は自分のプロジェクトにパスワードリセット機能を持っています。トークンを使用してユーザーにリンクを送信しています。彼らがリンクをクリックした後、私はHomeController
の中に入り、ResetPassword
メソッドを呼び出す必要があります。私の問題は、私がどこに置いても、私がログインページを開いたときに、ResetPassword
パーシャルビュー(それはモーダル)をどこに置かなければならないのかわからないということです。彼らはそれをクリックしたときに、私はこの方法に行く必要がパーシャルビューはどこに置くべきですか
http://...myurlaction=resetpassword&userid=5&[email protected]&token=1234564
:
は、最初の方法を取得するようになった:
[HttpGet]
[Route("resetpassword")]
[AllowAnonymous]
public ActionResult ResetPassword(ResetPasswordRequest resetPasswordRequest)
{
//check if Token is valid show the view
return PartialView();
}
は、ユーザーの電子メールでこのリンクを考えます投稿後、POST
メソッド:
[HttpPost]
[Route("resetpassword")]
public ActionResult ResetPassword(ResetPasswordView resetPasswordView)
{
return PartialView();
}
、これは部分図である。
<div id="myModal" class="modal">
<div class="modal-content">
<span class="close">x</span>
@using (Html.BeginForm("resetpassword", "Home", FormMethod.Post))
{
<h5>Reset Your Loan Center Password</h5>
<table>
<tr><td>Email Address</td><td><input type="email" name="Email" placeholder="[email protected]"></td></tr>
<tr><td>Password</td><td><input type="Password" name="Password" placeholder="Create Password"></td></tr>
<tr><td>Confirm Password</td><td><input type="Password" name="ConfirmPassword" placeholder="Re-enter Password"></td></tr>
<tr><td colspan="2"><input type="submit" value="Reset Password"></td></tr>
<tr>
<td class="errMessage" colspan="2">
@Html.ValidationSummary(true)
</td>
</tr>
</table>
}
</div>
私の問題は、私はどこでも私はそれがあってもリセットパスワードビューを表示持っているので、@Html.Partial("Login")
を持っている必要がどこかわからないということですIドンそれを示す必要はありません。
あなたPOSTメソッドも必要です
は '[のAllowAnonymous]' - ユーザーがまだ認可されていない –@Stephen Muecke(と彼らは同じシグネチャを持つべきではない)、事はそれは私の後にポストに進むですビューに値を入力しますが、それは取得に行くわけではありません。 – Alma