protected void btnLogin_Click(object sender, EventArgs e) { objLogin.Username = txtUsername.Text; objLogin.Password = txtPassword.Text; DataTable dtUser = new DataTable(); dtUser = objLogin.ValidateLogin(); if (dtUser.Rows.Count == 0) { lblMessage.Text = "Invalid Credentials!"; } else { DataRow drLogin; drLogin = dtUser.Rows[0]; Session["LoginName"] = drLogin["LoginName"].ToString(); Session["Rights"] = drLogin["Rights"].ToString(); Response.Redirect("AddNewProject.aspx"); } }
protected void btnLogin_Click(object sender, EventArgs e) { objLogin.UserName = txtUserName.Text; objLogin.Password = txtPassword.Text; DataTable dtLogin = null; dtLogin = objLogin.ValidateLogin(); if (dtLogin.Rows.Count == 0) { lblMessage.Text = "Login Inválido"; } else { DataRow drLogin; drLogin = dtLogin.Rows[0]; Session["LoginName"] = drLogin["LoginName"].ToString(); Session["Rights"] = drLogin["Rights"].ToString(); Session.Timeout = 7200; Response.Redirect("default.aspx"); } }