In my admin page i am trying to get the Users UserName, Password, and Email to repopulate controls when the admin clicks a user name from a gridview. I can’t seem to get the password though as it is requiring a parameter(password answer) that i can’t find.
I’m using the stored procedures of the ASPNETDB database.
For Each usr As MembershipUser In Membership.GetAllUsers()
Debug.Print(usr.Email)
Debug.Print(usr.UserName)
Debug.Print(usr.GetPassword("")) 'This line errors out
Next
You have to turn on the Membership.EnablePasswordRetrieval Property. Here’s the example configuration from MSDN:
Note that the line
enablePasswordRetrieval="true"is what you should check for in themembershipsection of thesystem.websection of the Web.config file for your ASP.NET application.