コード例 #1
0
        /// <summary>
        /// Handles OnLoad event at Page level<br/>
        /// Performs OnLoad actions that are common to all Pages.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs"></see> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            // add CurrentTheme CSS
            RegisterCssFile(CurrentTheme.Name, CurrentTheme.CssFile);

            if (Request.Cookies["Rainbow_" + portalSettings.PortalAlias] != null)
            {
                if (!Config.ForceExpire)
                {
                    //jminond - option to kill cookie after certain time always
                    int minuteAdd = Config.CookieExpire;
                    PortalSecurity.ExtendCookie(portalSettings, minuteAdd);
                }
            }

            // Stores referring URL in viewstate
            if (!Page.IsPostBack)
            {
                if (Request.UrlReferrer != null)
                {
                    UrlReferrer = Request.UrlReferrer.ToString();
                }
            }


            //if ( ScriptManager.GetCurrent( this ) == null ) {
            //    ScriptManager scriptManager = new ScriptManager();
            //    //scriptManager.EnablePartialRendering = true;

            //    scriptManager.Scripts.Add( new ScriptReference( "PreviewScript.js", "Microsoft.Web.Preview" ) );
            //    scriptManager.Scripts.Add( new ScriptReference( "PreviewGlitz.js", "Microsoft.Web.Preview" ) );
            //    scriptManager.Scripts.Add( new ScriptReference( "PreviewDragDrop.js", "Microsoft.Web.Preview" ) );

            //    foreach ( Control c in Controls ) {
            //        if ( c is HtmlGenericControl ) {
            //            HtmlGenericControl genericControl = ( HtmlGenericControl )c;

            //            if ( genericControl.TagName.ToLower() == "body" ) {
            //                foreach ( Control bodyControl in genericControl.Controls ) {
            //                    if ( bodyControl is HtmlForm ) {
            //                        bodyControl.Controls.AddAt( 0, scriptManager );
            //                    }
            //                }
            //                break;
            //            }
            //        }
            //    }
            //}

            base.OnLoad(e);
        }