how to unlock an ASPNETDB user account after bad password count lockout?

korben picture korben · Jun 21, 2010 · Viewed 7.1k times · Source

i'm new and using the login control with the ASPNETDB visual studio generated user database

i set a maximum bad password count of 5 in web.config and tested to the point that an account was locked out. i am however unable to figure out how to unlock the account now.

this problem is on my remotely hosted site, so this isn't something i can do with the visual studio asp.net configuration tool

some c# code i could run in the .cs page_load, that would let me input the username and have it unlocked would be great. then i could make a form to do it later when i need to easily.

thanks in advance for any help.

Answer

Brian picture Brian · Oct 25, 2011
  MembershipUser usr = Membership.GetUser(userName);
  usr.UnlockUser();