Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9016813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:06:22+00:00 2026-06-16T04:06:22+00:00

I have an MVC3 Razor web site. I am following the tutorial here: http://www.thecodingguys.net/tutorials/asp/webpages-membership-forgot-password-and-reset-password

  • 0

I have an MVC3 Razor web site. I am following the tutorial here:

http://www.thecodingguys.net/tutorials/asp/webpages-membership-forgot-password-and-reset-password

I have been able to generate a token and send the email successfully

Then the email has me going to a resetpassword view at a link like this:

~/Account/resetpassword?token=fujgFIo7k27c72-UTTJeGA2fujgFIo7k27c72-UTTJeGA2

Now, here is my HttpGet method

    [AllowAnonymous]
    [HttpGet]
    public ActionResult resetpassword()
    {
        ResetPasswordModel model = new ResetPasswordModel()
        {
            Password = String.Empty,
            ConfirmPassword = String.Empty,
            Token = String.Empty
        };
        return View(model);
    }

All it does is pass in an instance of the model

My view for resetpassword.cshtml

@model RazorARPP.Models.ResetPasswordModel
@{    
    var token = Request["token"];
    Model.Token = token;
}



<form action="" method="post" enctype="multipart/form-data" id="MyForm">
@Html.ValidationSummary(true)
<fieldset>
<legend>Reset Password</legend>
@Html.HiddenFor(m => m.Token)
@Html.LabelFor(m => m.Password)
@Html.PasswordFor(m => m.Password)
@Html.ValidationMessage("password")

<br/>

@Html.LabelFor(m => m.ConfirmPassword)
@Html.PasswordFor(m => m.ConfirmPassword)
@Html.ValidationMessage("confirmPassword")

<input type="submit"/>

</fieldset>
</form>

Now My HttpPost method

[AllowAnonymous]
    [HttpPost]
    public ActionResult resetpassword(ResetPasswordModel model)
    {
        if (model.Password == model.ConfirmPassword)
        {
            WebSecurity.ResetPassword(model.Token, model.Password);
        }
        return RedirectToAction("Login");
    }

It executes fine but the resetpassword isn’t working. I made sure that that line is running in the debugger. Any suggestions as to what I am doing wrong? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:06:24+00:00Added an answer on June 16, 2026 at 4:06 am

    How are you generating the reset token? Are you using the correct username?

    WebSecurity.GeneratePasswordResetToken(model.Email)
    

    Do a test where you generate a token and immediately pass it to WebSecurity.ResetPassword. I’m guessing resetpassword is not getting the values you are expecting

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have run through the MVC3 Razor tutorial on ASP.Net, and and have started
I have a web site in asp.net mvc 3 razor and have some range
I have an ASP.NET MVC3 web application with C# and Razor. Through a form
I have something like this in Site.Master in an asp.net mvc3 (not razor) project:
I am developing an ASP.Net MVC 3 Web application using Razor Views. I have
In a ASP.NET MVC3 Razor project I have 2 Models public class Post {
I have built an ASP.NET MVC 3 web application (with exlusively Razor/cshtml pages) that
I'm using jQuery Validate Unobtrusive with ASP.NET MVC3 Razor. I have a page with
I am building ASP.NET MVC3/Razor C# and I need two sides/interface base web aplication,
I have online form builder appplication in ASP.NET MVC3 with Razor views. It is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.