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.
 }
示例#2
0
        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.
        }
示例#3
0
        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);
            }
        }