Last post Jul 03, 2008 08:56 PM by anas
Jun 25, 2008 01:25 PM|feras80|LINK
I'm new in enterprise library.
I'm using the membership library to create a change password form in C#.s
the changepassword method takes two parameters: old password and new password
however, it doesn't throw any exception in case a user enters a Wrong old_password.
I tried to get the current password for the current loged in user so i can match it with the one entered, but i couldn't
Do you guys have any suggestion to solve this issue?
here is the code
String _userName = Request["ID"];
MembershipUser _user = Membership.GetUser(_userName);
this.lblerror.Visible = false;
catch ( Exception ex)
this.lblerror.Text = ex.Message;
Jul 03, 2008 08:56 PM|anas|LINK
I'm not sure how this question related to Enterprise library ,
ChangePassword method return a boolean value that indicate whether the password updated or not , so depending on that value , you can throw an exception
if (_user.ChangePassword(this.txtOldPassword.Text.Trim(), this.txtNewPassword.Text.Trim())==false)
throw new Exception(" Password doesn't changed ! ")