How to use secret answer in .NET with Membership.Provider

I am using Memberhip.Provider for security in my MVC application. I have a forgotten password page that asks for your username and then gives a secret question in a file. My question is how to check the secret answer for what is in the file. I cannot find any method that does this besides

Membership.Provider.ResetPassword(userName, secretAnswer) 

      

which basically asserts everything I type.

0


source to share


2 answers


In your web.config setting, you have to tell the membership provider to use a secret question.

This requiresQuestionAndAnswer="true"

is where you set the membership provider.



Edit: Your comment is requiresQuestionAndAnswer

set to "false" - it should be "true"

+3


source


You have to use password reset, see example http://msdn.microsoft.com/en-us/library/system.web.security.sqlmembershipprovider.resetpassword.aspx



0


source







All Articles