BlogEngine.Core.Web.Controls.BlogBasePage.OnLoad C# (CSharp) Method

OnLoad() protected method

Raises the E:System.Web.UI.Control.Load event. Adds links and javascript to the HTML header tag.
protected OnLoad ( EventArgs e ) : void
e System.EventArgs The object that contains the event data.
return void
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            string relativeWebRoot = Utils.RelativeWebRoot;
            Uri absoluteWebRoot = Utils.AbsoluteWebRoot;
            string instanceName = BlogSettings.Instance.Name;

            if (!Page.IsCallback)
            {
                // Links
                AddGenericLink("contents", "Archive", string.Format("{0}archive.aspx", relativeWebRoot));
                AddGenericLink("start", instanceName, relativeWebRoot);
                AddGenericLink("application/rdf+xml", "meta", "SIOC", string.Format("{0}sioc.axd", absoluteWebRoot));
                AddGenericLink("application/apml+xml", "meta", "APML", string.Format("{0}apml.axd", absoluteWebRoot));
                AddGenericLink("application/rdf+xml", "meta", "FOAF", string.Format("{0}foaf.axd", absoluteWebRoot));

                if (string.IsNullOrEmpty(BlogSettings.Instance.AlternateFeedUrl))
                {
                    AddGenericLink(
                        "application/rss+xml",
                        "alternate",
                        string.Format("{0} (RSS)", instanceName),
                        string.Format("{0}?format=rss", Utils.FeedUrl));
                    AddGenericLink(
                        "application/atom+xml",
                        "alternate",
                        string.Format("{0} (ATOM)", instanceName),
                        string.Format("{0}?format=atom", Utils.FeedUrl));
                }
                else
                {
                    AddGenericLink("application/rss+xml", "alternate", instanceName, Utils.FeedUrl);
                }

                AddGenericLink("application/rsd+xml", "edituri", "RSD", string.Format("{0}rsd.axd", absoluteWebRoot));

                AddMetaContentType();

                AddDefaultLanguages();

                Scripting.Helpers.AddBundledStylesAndScripts(this);

                if (BlogSettings.Instance.EnableOpenSearch)
                {
                    AddGenericLink(
                        "application/opensearchdescription+xml",
                        "search",
                        instanceName,
                        string.Format("{0}opensearch.axd", absoluteWebRoot));
                }

                Scripting.Helpers.AddCustomCodeToHead(this);

                Scripting.Helpers.AddTrackingScript(this);
            }
        }