I am using the following control in the page and it asks for the "username, current password and then enter the new password. user does NOT have to be login to change password using this.
<asp:ChangePassword ID="ChangePassword1" runat="server" OnChangedPassword="ChangePassword1_PasswordChanged"
ChangePasswordTitleText="" CancelDestinationPageUrl="/" DisplayUserName="True"
BorderPadding="4" Font-Names="Verdana" Font-Size="X-Small" SuccessPageUrl="/" FailureTextStyle-HorizontalAlign="Left"
TextBoxStyle-Width="150">
</asp:ChangePassword>
in code behind:
protected void ChangePassword1_PasswordChanged(object sender, EventArgs e)
{
MembershipUser user = System.Web.Security.Membership.GetUser(ChangePassword1.UserName);
user.IsApproved = true;
Membership.UpdateUser(user);
}
//override the allow anonymous property to true
protected override bool AllowAnonymousAccess
{
get
{
return true;
}
}
protected override bool AllowNullWeb
{
get
{
return true;
}
}
Error message:
soon as i hit change password button, i get the following error message:
Exception Details: System.NotImplementedException: The method or operation is not implemented.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |