protected void BtnLogin_Click(object sender, EventArgs e) { Login1 lObj = new Login1(); DataTable d = new DataTable(); int check; string Username; check = lObj.log_in(tbEmail.Text, tbPassword.Text, out d); if (check == 1) { SessionUserName s = new SessionUserName(); Username = s.User(tbEmail.Text, out d); Session["Username"] = Username; Thread.Sleep(milliseconds); Response.Redirect("AfterLogin1.aspx"); } else { Thread.Sleep(milliseconds); lblMsg.Text = "Username and Password is incorrect"; } }