ResetPassword method in ASP.NET 4.0
<p>The <code>ResetPassword</code> method is able to reset the old password, but user is unable to login with the new password generated by <code>ResetPassword</code> method. Code: </p>

<pre><code>String user =(((TextBox)PasswordRecovery2.Controls[0].FindControl("UserName")).Text).ToString();
String newPassword = clsStatic.RandomString(10, false);
MembershipUser username = Membership.GetUser(user);
String resetPassword = username.ResetPassword();
username.ChangePassword(resetPassword, newPassword);
</code></pre>
