protected void Page_Load(object sender, EventArgs e) { Security s = new Security(); if (s.IsStudent() || !s.IsLoggedIn()) { Response.Redirect("Home.aspx"); } }
private void CheckSecurity() { Security mySecurity = new Security(); lblFirstname.Text = mySecurity.Firstname; if (!mySecurity.IsLoggedIn()) { btnLogout.Visible = false; } else { //Adjust links visible according to Security Level(Admin or Regular) UpdatePanelLogin.Visible = false; pnlLogout.Visible = true; hlRegistration.Visible = false; } }
protected void btnLogin_Click(object sender, EventArgs e) { string FullEmail = txtUserName.Text; Security mySecurity = new Security(FullEmail, txtPassword.Text); if (mySecurity.IsLoggedIn()) { if (mySecurity.IsTeacher() || mySecurity.IsAdmin()) { Response.Redirect("TeacherInstructions.aspx"); } Response.Redirect("Home.aspx"); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "alert('Your User Name or Password Not Correct');", true); } }
protected void btnLogin_Click(object sender, EventArgs e) { string FullEmail = txtUserName.Text; Security mySecurity = new Security(FullEmail, txtPassword.Text); if (mySecurity.IsLoggedIn()) { if (mySecurity.IsTeacher()||mySecurity.IsAdmin()) { Response.Redirect("TeacherInstructions.aspx"); } Response.Redirect("Home.aspx"); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "alert('Your User Name or Password Not Correct');", true); } }