protected new void Page_Init(object sender, EventArgs e)
		    {
			    base.Page_Init(sender, e);

			    if (Tile == null) return;

			    _assessmentID = DataIntegrity.ConvertToInt(Tile.TileParms.GetParm("assessmentID"));
                _level = (Base.Enums.EntityTypes)Tile.TileParms.GetParm("level");
			    _levelID = (Int32)Tile.TileParms.GetParm("levelID");
		    }
        protected new void Page_Init(object sender, EventArgs e)
        {
            base.Page_Init(sender, e);

            if (Tile == null) return;

            Level = (Base.Enums.EntityTypes)Tile.TileParms.GetParm("level");
            LevelID = DataIntegrity.ConvertToInt(Tile.TileParms.GetParm("levelID"));

            AttatchLevelToKeys();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Tile == null) return;

            // Simulate IsPostBack.
            String postBackControlID = GetControlThatCausedPostBack(Parent.Page);
            _isPostBack = !String.IsNullOrEmpty(postBackControlID) && !postBackControlID.StartsWith("folder");

            _level = (Base.Enums.EntityTypes)Tile.TileParms.GetParm("level");
            _levelID = (Int32)Tile.TileParms.GetParm("levelID");
            _userID = SessionObject.LoggedInUser.Page;

            List<AsyncPageTask> taskList = new List<AsyncPageTask>();
            if (!_isPostBack)
            {
                taskList.Add(new AsyncPageTask(BuildStandardSets));
            }
            taskList.Add(new AsyncPageTask(BuildStandards));

            foreach (AsyncPageTask page in taskList)
            {
                PageAsyncTask newTask = new PageAsyncTask(page.OnBegin, page.OnEnd, page.OnTimeout, "StandardsSearch", true);
                Page.RegisterAsyncTask(newTask);
            }
            taskList = null;
            Page.ExecuteRegisteredAsyncTasks();

            // Create the initial viewstate values.
            if (ViewState[_standardSetFilterKey] == null)
            {
                ViewState.Add(_standardSetFilterKey, "All");
                ViewState.Add(_gradeFilterKey, "All");
                ViewState.Add(_subjectFilterKey, "All");
            }

            // Set the current filter visibility.
            SetFilterVisibility();

            if (!_isPostBack)
            {
                BuildStandardSets();
                BuildGrades();
                BuildSubjects();
                BuildStandards();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _isArchives = Tile != null && Tile.TileParms != null && Tile.TileParms.GetParm("archives") != null;
            divAssessmentItemUsageReport.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Access_AssessmentItemUsageReport); ;
			divDAReportFL.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Access_DAReport_Florida);
			divDAReportGen.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Access_DAReport_General);
			divExportFiles.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Access_ExportFiles);
			divExtractEngine.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Access_ExtractEngine);
			divProficiencyPortal.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Report_ProficiencyPortal);
			divProficiency.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Report_ProficiencyReportState);
			divReportBuilder.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Access_ReportBuilder);
			divReportEngine.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Access_ReportEngine);
			divStateAnalysis.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Access_StateAnalysis);
			divStateAssessments.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Report_SummativeReport);
			divTeacherStudentLearningObjectives.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Hyperlink_TeacherStudentLearningObjectives);
			divBalancedScorecard.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Hyperlink_BalancedScorecard);
			divCompetencyTrackingPortal.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Hyperlink_CompetencyTrackingPortal);
            divCredentialTrackingPortal.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Access_CredentialTrackingReport);
            divUsageReport.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Access_UsageReport);
            dvChecklistReport.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Access_AdvisementChecklist);
            dvSecureAssessmentResultsReport.Visible = !_isArchives && UserHasPermission(Base.Enums.Permission.Access_SecureTesting_SecureAssessmentResultsReport);

            if ((!_isArchives && !UserHasPermission(Base.Enums.Permission.Tile_ArchivedReporting)) || _isArchives)
            {
                divStateAssessmentsArchive.Visible = UserHasPermission(Base.Enums.Permission.Report_SummativeReportState_Archivedreporting);
                divProficiencyArchive.Visible = UserHasPermission(Base.Enums.Permission.Report_ProficiencyReportState_Archivedreporting);
                divTeacherStudentLearningObjectivesArchive.Visible = UserHasPermission(Base.Enums.Permission.Hyperlink_TeacherStudentLearningObjectives);
            }
            else
            {
                divStateAssessmentsArchive.Visible = false;
                divProficiencyArchive.Visible = false;
                divTeacherStudentLearningObjectivesArchive.Visible = false;
            }
           
            dvStarReport.Visible = UserHasPermission(Base.Enums.Permission.Access_Report_StarReport);

            //this is quick coding to get grouping into OH/MA. Needs to be changed at some point -PLH
            if (Tile.TileParms.Parms.ContainsKey("level"))
            {
                _level = (Base.Enums.EntityTypes)Tile.TileParms.GetParm("level");
            }

            if (Tile.TileParms.Parms.ContainsKey("schoolID"))
            {
                _schoolID = (int)Tile.TileParms.GetParm("level");
            }

            string _passedGroupParm = string.Empty;
            switch (_level)
            {
                case Base.Enums.EntityTypes.District:
                case Base.Enums.EntityTypes.School:
                case Base.Enums.EntityTypes.Teacher:
                    _passedGroupParm = _level.ToString().ToLower();
                    break;
                default:
                    _passedGroupParm = "none";
                    break;
            }

            if (Tile.TileParms.Parms.ContainsKey("level"))
            {
                lnkReportEngine.HRef = ResolveUrl("~/SessionBridge.aspx?ReturnURL=") + "fastsql_v2_direct.asp?ID=6740|reportengine%26engineType=ReportEngine&??userID=" + SessionObject.LoggedInUser.UserId.ToString() + "&??rolePortal=" + _passedGroupParm + "&??schoolID=" + _schoolID.ToString() + "&selectedReport=Report Engine";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Tile == null) return;

            if(!UserHasPermission(Base.Enums.Permission.Tile_Standards))
            {
                Tile.ParentContainer.Visible = false;
            }

            level = (Thinkgate.Base.Enums.EntityTypes)Tile.TileParms.GetParm("level");
            levelID = DataIntegrity.ConvertToInt(Tile.TileParms.GetParm("levelID"));
            classID = level == Thinkgate.Base.Enums.EntityTypes.Class ? levelID : DataIntegrity.ConvertToInt(Tile.TileParms.GetParm("selectID"));
            _planID = DataIntegrity.ConvertToInt(Tile.TileParms.GetParm("planID"));
            _term = DataIntegrity.ConvertToInt(Tile.TileParms.GetParm("term"));
            selectedFolder = Tile.TileParms.GetParm("folder").ToString();
            standardsAssignedToItemTileGrid.Visible = false;
            StandardsCoursesXmlHttpPanel.Attributes["gridClientID"] = standardsSearchTileGrid.ClientID;
            StandardsSubjectsXmlHttpPanel.Attributes["gridClientID"] = standardsCurriculumSearchTileGrid.ClientID;

            if (Tile.TileParms.GetParm("showCalendarIcon") != null)
                _calendarIconVisible = DataIntegrity.ConvertToBool(Tile.TileParms.GetParm("showCalendarIcon"));

            var calendarColumn = standardsSearchTileGrid.Columns.FindByUniqueName("AddToCalendar");
            if (calendarColumn != null) calendarColumn.Visible = _calendarIconVisible;

            string postBackControlID = "";
            switch (level)
            {
                case Thinkgate.Base.Enums.EntityTypes.Student:
                case Thinkgate.Base.Enums.EntityTypes.Teacher:
                    postBackControlID = GetControlThatCausedPostBack(Parent.Page);
                    if(string.IsNullOrEmpty(postBackControlID)) postBackControlID = "";

                    if (selectedFolder == "Classes" && classID > 0)
                    {
                        LoadStandardsSearchButtonFilters();
                    }
                    else if (selectedFolder == "Curriculum" && classID == 0) {
                        standardsSetSearchDropdown.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(CurriculumFolder_StandardSetButton_SearchStandardsBySetAndCourse_Click);

                        if(postBackControlID.IndexOf("standardsSubjectSearchDropdown") == -1 && postBackControlID.IndexOf("standardsSetSearchDropdown") == -1)
                        {
                            LoadStandardsSearchButtonFilters();
                        }
                    }
                    break;

                case Thinkgate.Base.Enums.EntityTypes.Class:
                    postBackControlID = GetControlThatCausedPostBack(Parent.Page);
                    if(string.IsNullOrEmpty(postBackControlID)) postBackControlID = "";

                    selectedFolder = "Classes";
                    if (classID > 0)
                    {
                        standardsSetSearchDropdown.Width = 100;
                        standardsCourseSearchDropdown.Width = 100;
                        standardsSubjectSearchDropdown.Width = 100;
                        LoadStandardsSearchButtonFilters();
                    }
                    break;

                case Thinkgate.Base.Enums.EntityTypes.BankQuestion:
                    var oBQ = Tile.TileParms.GetParm("item") as BankQuestion;
                    var dtBQStds = BankQuestion.GetItemStandardsAsDataTable(oBQ);
                    int standardsRecordCount = dtBQStds.Rows.Count;

                    postBackControlID = GetControlThatCausedPostBack(Parent.Page) ?? "";
                    
                    /******************************************************************
                     * Set up the grids and controls we intend to show when this tile
                     * is used to display an item's standards.
                     * ***************************************************************/
                    standardsCurriculumSearchTileGrid.Visible = false;
                    standardsSearchTileGrid.Visible = false;
                    standardsSetSearchDropdown.Visible = false;
                    standardsCourseSearchDropdown.Visible = false;
                    standardsSubjectSearchDropdown.Visible = false;
                    standardSearchMoreLink.Visible = false;
                    searchHolder.Visible = false;

                    if (standardsRecordCount > 0)
                    {
                        standardsAssignedToItemTileGrid.Visible = true;
                        standardNoRecordsMsg.Visible = false;
                        standardsAssignedToItemTileGrid.DataSource = dtBQStds;
                        standardsAssignedToItemTileGrid.DataBind();
                        if (standardsRecordCount > 100) standardSearchMoreLink.Visible = true;
                    } 
                    else
                    {
                        standardNoRecordsMsg.Visible = true;
                    }
                    break;

                case Thinkgate.Base.Enums.EntityTypes.TestQuestion:
                    var oTQ = Tile.TileParms.GetParm("item") as TestQuestion;

                    //var drArray = StandardMasterList.dtStandards.Select("ID = " + oTQ.StandardID.ToString());
                    //if (drArray.Length > 0)
                    //{
                    //    oTQ.StandardName = drArray[0]["StandardName"].ToString();
                    //}

                    //oTQ.StandardName = StandardMasterList.GetStandardRowByID(oTQ.StandardID)["StandardName"].ToString() ?? "";
                    var drStd = Thinkgate.Base.Classes.Standards.GetStandardRowByID(oTQ.StandardID);
                    oTQ.StandardName = (drStd != null) ? drStd["StandardName"].ToString() : "";

                    DataTable dtTQStds = new DataTable();

                    dtTQStds.Columns.Add("ID", typeof (int));
                    dtTQStds.Columns.Add("StandardName", typeof (string));
                    dtTQStds.Columns.Add("StandardText", typeof(string));

                    var dr = dtTQStds.NewRow();
                    dr["ID"] = oTQ.StandardID;
                    dr["StandardName"] = oTQ.StandardName;
                    dr["StandardText"] = (drStd != null) ? drStd["Desc"].ToString() : "";
                    dtTQStds.Rows.Add(dr);
                    dtTQStds = Standpoint.Core.Classes.Encryption.EncryptDataTableColumn(dtTQStds, "ID", "ID_Encrypted");

                    postBackControlID = GetControlThatCausedPostBack(Parent.Page) ?? "";
                    
                    /******************************************************************
                     * Set up the grids and controls we intend to show when this tile
                     * is used to display an item's standards.
                     * ***************************************************************/
                    standardsCurriculumSearchTileGrid.Visible = false;
                    standardsSearchTileGrid.Visible = false;
                    standardsSetSearchDropdown.Visible = false;
                    standardsCourseSearchDropdown.Visible = false;
                    standardsSubjectSearchDropdown.Visible = false;
                    standardSearchMoreLink.Visible = false;
                    searchHolder.Visible = false;
                    standardsAssignedToItemTileGrid.Visible = true;
                    standardNoRecordsMsg.Visible = false;
                    standardsAssignedToItemTileGrid.DataSource = dtTQStds;
                    standardsAssignedToItemTileGrid.DataBind();
                
                    break;
            }

            //For Now, If _calendarIconVisible is true we are on the Instructional Plan page and want to hide filters
            if (_calendarIconVisible)
            {
                standardsSetSearchDropdown.Visible = false;
                standardsCourseSearchDropdown.Visible = false;
                standardsSubjectSearchDropdown.Visible = false;
                radGridContainerDiv.Attributes["style"] = "width: 98%; height: 227px; padding: 3px; overflow: auto;"; //adding height
            }
        }