ASP.NET Membership - Change password without asking the old (WITH Question and Answer)

Posted by djsolid on ASP.net Weblogs See other posts from ASP.net Weblogs or by djsolid
Published on Wed, 21 Apr 2010 06:26:57 GMT Indexed on 2010/04/21 6:34 UTC
Read the original article Hit count: 306

Filed under:
|

I have received many comments and questions about how you can do what is described in this post when you site requires question and answer.

The solution is definiterly not the best and should be used with EXTREME caution because in a high traffic website can cause problems but I write it down anyway.

We will use reflection in order to solve our problem.

And this is the code

image

But this code changes the only instance of MembershipProvider meaning if you access somewhere else from your application the property RequiresQuestionAndAnswer until you set back it’s original value you will get false instead of true.

So again be VERY careful.

Hope you find it useful!

kick it on DotNetKicks.com

© ASP.net Weblogs or respective owner

Related posts about ASP.NET

Related posts about membership