protected void btnChange_Click(object sender, EventArgs e) { ///changes the current password ///if there is no temp passsword supplied then treat it as a typical user ///wanting to change their password ///if there is a temp password then treat it as a user who ///has forgotten their password //var to store any errors string Error; //if there is no temp password if (TempPW == null) { //change the password as a typical user Error = Sec.ChangePassword(Sec.UserEMail, txtCurrentPassword.Text, txtPassword1.Text, txtPassword2.Text); } else { //change the password based on a forgotten password Error = Sec.ChangePasswordWithTempPW(EMail, TempPW, txtPassword1.Text, txtPassword2.Text); } //display any errors lblError.Text = Error; }