protected override void OnPreInit(EventArgs e) { Security s = new Security(); if (s.IsStudent()) { this.MasterPageFile = "NestedStudentMasterPage.Master"; } else if(s.IsTeacher() || s.IsAdmin()) { this.MasterPageFile = "NestedTeacherMasterPage.Master"; } // default is neither. }
protected override void OnPreInit(EventArgs e) { Security s = new Security(); if (s.IsStudent()) { this.MasterPageFile = "NestedStudentMasterPage.Master"; } else if (s.IsTeacher() || s.IsAdmin()) { this.MasterPageFile = "NestedTeacherMasterPage.Master"; } // default is neither. }
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); } }