protected void btnLoginSubmit_Click(object sender, EventArgs e) { _userName = txtUserName.Text; _password = txtPassword.Text; if (AdService.IsValidUser(_userName, _password, _domain)) { log.Info(_userName + " " + _password + " is authenticated"); Session["UserId"] = _userName; Response.Redirect("Default.aspx", true); } else { lblErrorMsg.Text = "Invalid User Please check UserName and Password"; log.Error(_userName + " " + _password + " is not correct"); } }