Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ResetPassword fails despite resetting the password
- <membership defaultProvider="AspNetSqlMembershipProvider">
- <providers>
- <clear/>
- <add name="AspNetSqlMembershipProvider"
- type="System.Web.Security.SqlMembershipProvider"
- passwordFormat="Hashed"
- connectionStringName="SqlConnectionString"
- enablePasswordRetrieval="false"
- enablePasswordReset="true"
- requiresQuestionAndAnswer="false"
- requiresUniqueEmail="true"
- maxInvalidPasswordAttempts="5"
- minRequiredPasswordLength="3"
- minRequiredNonalphanumericCharacters="0"
- passwordAttemptWindow="10"
- applicationName="/"/>
- </providers>
- </membership>
- public static string ResetPassword(string username)
- {
- MembershipUser user = Membership.GetUser(username);
- if (user != null)
- {
- string resetPassword = user.ResetPassword(); //This line throws the exception
- /* SNIP - Emailing code */
- return "Your password has been reset and emailed to you.";
- }
- else
- {
- return "Password could not be reset. Please check the email address you entered was correct.";
- };
- }
Add Comment
Please, Sign In to add comment