Link to home
Start Free TrialLog in
Avatar of volking
volking

asked on

ASP.NET Membership Provider Password Conundrum!

when using ASP.NET 2.0 Membership provider
I want users to be able to reset their own passwords ....
so I use [requiresQuestionAndAnswer=true]

But how does an ADMINISTRATOR force a password reset when the the user has forgotten BOTH password and password question????

I thought below code would do it, but apparently NOT, because below code needs  [requiresQuestionAndAnswer=false]

arrrrrrrgh!

Trying to force an ASP Membership User Password to a known value.
Note: An user with the name of "myusername" does exist

#1 - Dim userInfo As MembershipUser = Membership.GetUser("myusername")
#2 - Dim TempPassword As String = "ABC123"
#3 - Dim rndPass As String = userInfo.ResetPassword()
#4 - userInfo.ChangePassword(rndPass, TempPassword)

Line #3 generates the error: Value cannot be null. Parameter name: passwordAnswer

So how does an ADMIN force a password reset?????
ASKER CERTIFIED SOLUTION
Avatar of volking
volking

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial