3.5 password recovery control in an mvc app? 

حمایت از ما | مشهدهاست 3.5 password recovery control in an mvc app?

حمایت از ما | مشهدهاست

حمایت از ما | مشهدهاست حمایت از ما | مشهدهاست

حمایت از ما | مشهدهاست
` 3.5 password recovery control in an mvc app?


6 years ago


5696 times


3 years ago

Can I use the 3.5 Password Recovery control in an MVC application?

We need to provide password retrieval capability for our MVC app and I would like to use the password recovery control which only works with a web form app.

2010-05-06 16:12:42Z


Unlike Login and Logout, the Password Recovery feature does not come implemented in a brand new ASP.NET MVC project, however, adding this feature to an ASP.NET MVC project is actually pretty easy as the Membership class already has the core functionality built-in.

I've posted in my blog an explanation on how I did it:


A couple points on the current state-of-the-art (as of Oct, 2011):

1st: there's a good chance you don't actually want password "recovery" since it's considered a security risk and you have to turn-off one-way password encryption to be able to implement it. Instead, most people implement password "reset".

If you really do want to allow "recovery" then:

1) When you create a new internet project in VS2010, it creates: LogOn, Register, and ChangePassword pages for you. As Hector says, there's no password recovery created for you.

2) However, the Asp.Net Membership provider does support it, so you could add it by creating a Model, Controller and View yourself, setting enablePasswordRetrieval="true" and passwordFormat="Encryted" and calling Membership.GetUser().

If instead of password "Recovery" you actually want password "Reset" then there are a couple of ways to implement it: i) Self-service - where the user can click on a link and an email is sent to them with a link to reset the password.


This one I have tried. I like it because it handles both account confirmation and password reset: --

I have NOT tried any of these:




ii) Administrator Managed - you contact the administrator who then reset's your password for you. TroyGoode's MvcMembership Starter Kit that Gthompson83 refers to above is an example of this. There's a menu item called "User Administration" that's accessible to administrators and allows passwords to be reset or a random one generated and emailed to the user. It also let's you manage roles.


A lot of server controls from Webforms will not work on MVC as designed. Check out the MvcMembership starter kit.

 اين مطلب بدون دخالت انساني عينا از اين آدرس کپي شده و تمامي مسوليت آن با ناشر اصلي است.

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated
How to get a user's client IP address in ASP.NET?
The breakpoint will not currently be hit. No symbols have been loaded for this document in a Silverlight application
WCF - How to Increase Message Size Quota
How to get current page URL in MVC 3
Why is access to the path denied?

Read data from SqlDataReader
Get current date only in C#
How to add doublequotes to a string that is inside a variable?
Select method in List<t> Collection
Setting dropdownlist selecteditem programmatically
How to write a simple Html.DropDownListFor()?