客户在我的应用程序中注册为用户后,他们将被发送到登录页面。当他们登录时,我有一条消息告诉他们确认他们的电子邮件。目前,当我单击它时,它会转到 404。这是我发送电子邮件确认令牌的方法:
private async Task<string> SendEmailConfirmationTokenAsync(string userID, string subject)
{
string code = await UserManager.GenerateEmailConfirmationTokenAsync(userID);
var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = userID, code = code }, protocol: Request.Url.Scheme);
await UserManager.SendEmailAsync(userID, subject, "Please confirm your account by <a href=\"" + callbackUrl + "\">clicking here</a>");
return callbackUrl;
}
这是我在视图中的链接
@Html.ActionLink("click here", "SendEmailConfirmationTokenAsync", "Account")