protected void ButtonResetPassword_Click(object sender, EventArgs e) { CustomerUtility customer = new CustomerUtility().getUser(TextBoxUserName.Text); if (!String.IsNullOrEmpty(customer.email) && customer.email.Equals(TextBoxEmail.Text)) { int rand = new Random().Next(100000, 999999); string newpwd = "new" + rand; customer.resetPassword(newpwd); LabelMessage.Visible = true; LabelMessage.Text = "Your password has been reset as " + newpwd; LabelMessage.ForeColor = System.Drawing.Color.Red; sendNotification(customer.email, newpwd); } else { LabelMessage.Visible = true; LabelMessage.Text = "Your Email or UserName are not match!!"; LabelMessage.ForeColor = System.Drawing.Color.Red; } }