Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi to all,

i use asp membership,
now i want create a page for user for change password,but i don't want to use <asp:ChangePassword>
i want create this custom,
my problem is: i want check user oldpassword from oldpassword textbox ,if currect, password change, and display "success" message, or wrong, display "oldpassword wrong" message.

my html code is:

HTML
my problem is: i want check user oldpassword from oldpassword textbox ,if currect, password change, and display "success" message, or wrong, display "oldpassword wrong" message.


and my c# code is:
C#
protected void submitchangepassword_Click(object sender, EventArgs e)
       {
           try
           {
               System.Web.Security.MembershipUser usr = System.Web.Security.Membership.GetUser();
               usr.ChangePassword(oldpassword.Text, newpassword.Text);
               errorlabel.Text = "Success";
           }
           catch (Exception ex) { errorlabel.Text = ex.ToString(); }
       }



thank's for you'r help
Posted
Updated 5-Sep-13 8:46am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900