asp.net mvc 忘记密码 代码实现
时间: 2023-07-25 07:06:23
浏览: 98
以下是一个简单的 ASP.NET [mvc](https://geek.csdn.net/educolumn/12194d97268717583cf4464b919d22e3?spm=1055.2569.3001.10083) 忘记密码[功能](https://geek.csdn.net/educolumn/0cf712bbe06919ce80efc8d763fefd03?spm=1055.2569.3001.10083)的实现:
1. 创建 ForgotPassword [视图](https://geek.csdn.net/educolumn/16d64c826bce43361f2b0cb609152e67?spm=1055.2569.3001.10083)
在 Views 文件夹中创建 ForgotPassword.cshtml 视图,并在视图中添加一个表单,用于接收用户输入的电子邮件[地址](https://geek.csdn.net/educolumn/14a4193cfe4be4597b0afe7044078e22?spm=1055.2569.3001.10083)。
@model ForgotPasswordViewModel
@using (Html.BeginForm("ForgotPassword", "Account", FormMethod.[pos](https://geek.csdn.net/educolumn/0399089ce1ac05d7729a569fd611cf73?spm=1055.2569.3001.10083)t, new { @class = "form-horizontal" }))
<div class="form-group">
@Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" })
<div class="col-md-10">
@Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<button type="submit" class="btn btn-default">Send Password Reset Link</button>
```