protected void loginButton_Click(object sender, EventArgs e) { string centerCode = centerCodeTextBox.Text; string password = passwordTextBox.Text; string enPassword = EncryptSHA512Managed(password); if (centerManager.IsCenterCodeAndPasswordExists(centerCode, enPassword)) { Session["CenterId"] = centerManager.GetCenterId(); int centerId = centerManager.GetCenterId(); int thanaId = centerManager.GetThanaId(centerId); Session["DistrictId"] = centerManager.GetDistrictId(thanaId); Response.Redirect("HomeCenter.aspx"); } else { megLabel.Text = "Wrong centercode and password!"; } }