Exemple #1
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (LogOnViaGoogleLink.Visible)
            {
                LogOnViaGoogleLink.NavigateUrl = GoogleProvider.GetLoginUrl(this.OrganizationId, this.InstanceId);
            }

            bool modernTheme = (FrameworkConfiguration.Current.WebApplication.MasterPage.Theme == MasterPageTheme.Modern);

            if (this.EnableEmbeddedStyleSheets)
            {
                Micajah.Common.Pages.MasterPage.CreatePageHeader(this.Page, this.EnableClientCaching, true, true, modernTheme, modernTheme, false);
            }
            else if (!this.EnableClientCaching)
            {
                Micajah.Common.Pages.MasterPage.DisableClientCaching(this.Page);
            }

            if (TitleLabel != null)
            {
                TitleContainer.Visible = (!string.IsNullOrEmpty(TitleLabel.Text));
            }
            ErrorPanel.Visible = (!string.IsNullOrEmpty(ErrorPanel.InnerHtml));

            if (modernTheme)
            {
                ResourceProvider.RegisterValidatorScriptResource(this.Page);
            }

            if (m_MainContainerHeight > 0 && (MainContainer != null))
            {
                MainContainer.Style[HtmlTextWriterStyle.Height]    = m_MainContainerHeight.ToString(CultureInfo.InvariantCulture) + "px";
                MainContainer.Style[HtmlTextWriterStyle.MarginTop] = (-Convert.ToInt32(m_MainContainerHeight / 2)).ToString(CultureInfo.InvariantCulture) + "px";
            }
        }