protected void Page_Load(object sender, EventArgs e) { Security s = new Security(); if (s.IsStudent() || !s.IsLoggedIn()) { Response.Redirect("Home.aspx"); } }
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. }