protected void btnLogin_Click(object sender, EventArgs e) { try { SessionFactory.configfilepath = Server.MapPath("~/hibernate.cfg.xml"); AdminRepository adminRepo = new AdminRepository(); SocioBoard.Domain.Admin admin = adminRepo.GetUserInfo(txtUserName.Text, txtPassword.Text); if (admin != null) { Session["AdminProfile"] = admin; Response.Redirect("Dashboard.aspx"); } else { ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Please enter correct Username and password!');", true); } } catch (Exception ex) { } }
protected void btnLogin_Click(object sender, EventArgs e) { try { SessionFactory.configfilepath = Server.MapPath("~/hibernate.cfg.xml"); AdminRepository adminRepo = new AdminRepository(); SocioBoard.Domain.Admin admin = adminRepo.GetUserInfo(txtUserName.Text, txtPassword.Text); if (admin != null) { Session["AdminProfile"] = admin; Response.Redirect("Dashboard.aspx"); } } catch (Exception ex) { } }