This allows me to change the password, but the view is reset to its original state.
OnInit looks like this:
changePassword.ChangingPassword += ChangePasswordButton_Click;
and method implementation:
private void ChangePasswordButton_Click(object sender, EventArgs args)
{
MembershipUser user = Membership.GetUser();
string oldPassword = changePassword.CurrentPassword;
string newPassword = changePassword.NewPassword;
try
{
if (user.ChangePassword(oldPassword, newPassword))
{
}
else
{
}
}
catch (ArgumentException e)
{
}
}
I need to change the password when I should, so it selects the membership provider configuration.
I have both a SuccessTemplate and a ChangePasswordTemplate in an aspx file, but I don't know how to get the ChangePassword control to display SuccessTemplate. What am I missing?
source
share